DPC++ Runtime
Runtime libraries for oneAPI DPC++
sycl_fe_intrins.hpp
Go to the documentation of this file.
1 //==------ sycl_fe_intrins.hpp --- SYCL Device Compiler's FE intrinsics ----==//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 // C++ intrinsics recognized by the SYCL device compiler frontend
9 //===----------------------------------------------------------------------===//
10 
11 #pragma once
12 
13 #include <cstddef>
14 #include <cstdint>
15 
16 #ifdef __SYCL_DEVICE_ONLY__
17 
18 // Get the value of the specialization constant with given name.
19 // Post-link tool traces the ID to a string literal it points to and assigns
20 // integer ID.
21 template <typename T>
22 SYCL_EXTERNAL T __sycl_getScalarSpecConstantValue(const char *ID);
23 
24 template <typename T>
25 SYCL_EXTERNAL T __sycl_getCompositeSpecConstantValue(const char *ID);
26 
27 // The intrinsics below are used to implement support SYCL2020 specialization
28 // constants. SYCL2020 version requires more parameters compared to the initial
29 // version.
30 
31 // Get the value of the specialization constant with given symbolic ID.
32 // `SymbolicID` is a unique string ID of a specialization constant.
33 // `DefaultValue` contains a pointer to a global variable with the initializer,
34 // which should be used as the default value of the specialization constants.
35 // `RTBuffer` is a pointer to a runtime buffer, which holds values of all
36 // specialization constant and should be used if native specialization constants
37 // are not available.
38 template <typename T>
39 SYCL_EXTERNAL T __sycl_getScalar2020SpecConstantValue(const char *SymbolicID,
40  const void *DefaultValue,
41  const void *RTBuffer);
42 
43 template <typename T>
44 SYCL_EXTERNAL T __sycl_getComposite2020SpecConstantValue(
45  const char *SymbolicID, const void *DefaultValue, const void *RTBuffer);
46 
47 // Request a fixed-size allocation in local address space at kernel scope.
48 extern "C" SYCL_EXTERNAL __attribute__((opencl_local)) std::uint8_t *
49 __sycl_allocateLocalMemory(std::size_t Size, std::size_t Alignment);
50 
51 #endif
#define SYCL_EXTERNAL
__attribute__((always_inline)) auto invoke_simd(sycl
The invoke_simd free function invokes a SIMD function using all work-items in a sub_group.