Skip to content

Commit 4402f47

Browse files
author
Pavel Samolysov
committed
[SYCL] Fix a lot of llvm_unreachable("Invalid address space") errors
Currently, CLang doesn't support the generic address space. Sema treats the generic address space as LangAS::Default: /// If this is an OpenCL address space attribute, returns its SYCL /// representation in LangAS, otherwise returns default address space. LangAS asSYCLLangAS() const { switch (getKind()) { ... case ParsedAttr::AT_OpenCLGenericAddressSpace: default: return LangAS::Default; } } and then this LangAS::Default leads to an invocation of llvm_unreachable: if (ASIdx == LangAS::Default) llvm_unreachable("Invalid address space"); As a temporal solution, I've defined `__OPENCL_GENERIC_AS__` as an empty string for host as well as for device.
1 parent ebe1f47 commit 4402f47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sycl/include/CL/sycl/access/access.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ constexpr bool modeWritesNewData(access::mode m) {
123123
#define __OPENCL_LOCAL_AS__ __attribute__((opencl_local))
124124
#define __OPENCL_CONSTANT_AS__ __attribute__((opencl_constant))
125125
#define __OPENCL_PRIVATE_AS__ __attribute__((opencl_private))
126-
#define __OPENCL_GENERIC_AS__ __attribute__((opencl_generic))
126+
#define __OPENCL_GENERIC_AS__
127127
#else
128128
#define __OPENCL_GLOBAL_AS__
129129
#define __OPENCL_GLOBAL_DEVICE_AS__

0 commit comments

Comments
 (0)