DPC++ Runtime
Runtime libraries for oneAPI DPC++
defines_elementary.hpp
Go to the documentation of this file.
1
//==---------------- defines_elementary.hpp - DPC++ Explicit SIMD API ------==//
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
// Elementary definitions used in Explicit SIMD APIs.
9
//===----------------------------------------------------------------------===//
10
11
#pragma once
12
14
15
#ifdef __SYCL_DEVICE_ONLY__
16
#define SYCL_ESIMD_KERNEL __attribute__((sycl_explicit_simd))
17
#define SYCL_ESIMD_FUNCTION __attribute__((sycl_explicit_simd))
18
19
// Mark a function being nodebug.
20
#define ESIMD_NODEBUG __attribute__((nodebug))
21
// Mark a "ESIMD global": accessible from all functions in current translation
22
// unit, separate copy per subgroup (work-item), mapped to SPIR-V private
23
// storage class.
24
#define ESIMD_PRIVATE \
25
__attribute__((opencl_private)) __attribute__((sycl_explicit_simd))
26
// Bind a ESIMD global variable to a specific register.
27
#define ESIMD_REGISTER(n) __attribute__((register_num(n)))
28
29
#define __ESIMD_API ESIMD_NODEBUG ESIMD_INLINE
30
#else // __SYCL_DEVICE_ONLY__
31
#define SYCL_ESIMD_KERNEL
32
#define SYCL_ESIMD_FUNCTION
33
34
// TODO ESIMD define what this means on Windows host
35
#define ESIMD_NODEBUG
36
// On host device ESIMD global is a thread local static var. This assumes that
37
// each work-item is mapped to a separate OS thread on host device.
38
#define ESIMD_PRIVATE thread_local
39
#define ESIMD_REGISTER(n)
40
41
#define __ESIMD_API ESIMD_INLINE
42
#endif // __SYCL_DEVICE_ONLY__
43
44
// Mark a function being noinline
45
#define ESIMD_NOINLINE __attribute__((noinline))
46
// Force a function to be inlined. 'inline' is used to preserve ODR for
47
// functions defined in a header.
48
#define ESIMD_INLINE inline __attribute__((always_inline))
49
50
// Macros for internal use
51
#define __ESIMD_NS sycl::ext::intel::esimd
52
#define __ESIMD_DNS sycl::ext::intel::esimd::detail
53
#define __ESIMD_EMU_DNS sycl::ext::intel::esimd::emu::detail
54
#define __ESIMD_ENS sycl::ext::intel::experimental::esimd
55
#define __ESIMD_EDNS sycl::ext::intel::experimental::esimd::detail
56
#define __ESIMD_XMX_NS sycl::ext::intel::esimd::xmx
57
#define __ESIMD_XMX_DNS sycl::ext::intel::esimd::xmx::detail
58
59
#define __ESIMD_QUOTE1(m) #m
60
#define __ESIMD_QUOTE(m) __ESIMD_QUOTE1(m)
61
#define __ESIMD_NS_QUOTED __ESIMD_QUOTE(__ESIMD_NS)
62
#define __ESIMD_DEPRECATED(new_api) \
63
__SYCL_DEPRECATED("use " __ESIMD_NS_QUOTED "::" __ESIMD_QUOTE(new_api))
64
include
sycl
ext
intel
esimd
detail
defines_elementary.hpp
Generated by
1.8.17