diff --git a/clang/include/clang/Basic/TokenKinds.def b/clang/include/clang/Basic/TokenKinds.def index d598856088571..ed249deb84414 100644 --- a/clang/include/clang/Basic/TokenKinds.def +++ b/clang/include/clang/Basic/TokenKinds.def @@ -541,10 +541,10 @@ KEYWORD(__unaligned , KEYMS) KEYWORD(__super , KEYMS) // OpenCL address space qualifiers -KEYWORD(__global , KEYOPENCLC | KEYOPENCLCXX | KEYSYCL) -KEYWORD(__local , KEYOPENCLC | KEYOPENCLCXX | KEYSYCL) -KEYWORD(__constant , KEYOPENCLC | KEYOPENCLCXX | KEYSYCL) -KEYWORD(__private , KEYOPENCLC | KEYOPENCLCXX | KEYSYCL) +KEYWORD(__global , KEYOPENCLC | KEYOPENCLCXX) +KEYWORD(__local , KEYOPENCLC | KEYOPENCLCXX) +KEYWORD(__constant , KEYOPENCLC | KEYOPENCLCXX) +KEYWORD(__private , KEYOPENCLC | KEYOPENCLCXX) KEYWORD(__generic , KEYOPENCLC | KEYOPENCLCXX) ALIAS("global", __global , KEYOPENCLC | KEYOPENCLCXX) ALIAS("local", __local , KEYOPENCLC | KEYOPENCLCXX) diff --git a/clang/test/CodeGenSYCL/Inputs/sycl.hpp b/clang/test/CodeGenSYCL/Inputs/sycl.hpp index c0d39f945671b..675112b2c5016 100644 --- a/clang/test/CodeGenSYCL/Inputs/sycl.hpp +++ b/clang/test/CodeGenSYCL/Inputs/sycl.hpp @@ -1,9 +1,5 @@ #pragma once -#ifndef __SYCL_DEVICE_ONLY__ -#define __global -#endif - #define ATTR_SYCL_KERNEL __attribute__((sycl_kernel)) // Dummy runtime classes to model SYCL API. @@ -137,7 +133,7 @@ class accessor { _ImplT impl; private: - void __init(__global dataT *Ptr, range AccessRange, + void __init(__attribute__((ocl_global)) dataT *Ptr, range AccessRange, range MemRange, id Offset) {} }; diff --git a/clang/test/CodeGenSYCL/address-space-parameter-conversions.cpp b/clang/test/CodeGenSYCL/address-space-parameter-conversions.cpp index 6210544c41b78..39ccf338d4a67 100644 --- a/clang/test/CodeGenSYCL/address-space-parameter-conversions.cpp +++ b/clang/test/CodeGenSYCL/address-space-parameter-conversions.cpp @@ -6,7 +6,7 @@ void bar(int & Data) {} void bar2(int & Data) {} // CHECK-OLD-DAG: define spir_func void @[[RAW_REF2:[a-zA-Z0-9_]+]](i32* dereferenceable(4) % // CHECK-NEW-DAG: define spir_func void @[[RAW_REF2:[a-zA-Z0-9_]+]](i32 addrspace(4)* dereferenceable(4) % -void bar(__local int &Data) {} +void bar(__attribute__((ocl_local)) int &Data) {} // CHECK-DAG: define spir_func void [[LOC_REF:@[a-zA-Z0-9_]+]](i32 addrspace(3)* dereferenceable(4) % void foo(int * Data) {} // CHECK-OLD-DAG: define spir_func void @[[RAW_PTR:[a-zA-Z0-9_]+]](i32* % @@ -25,13 +25,13 @@ void usages() { // CHECK-DAG: [[GLOB:%[a-zA-Z0-9]+]] = alloca i32 addrspace(1)* __attribute__((address_space(1))) int *GLOB; // CHECK-DAG: [[LOC:%[a-zA-Z0-9]+]] = alloca i32 addrspace(3)* - __local int *LOC; + __attribute__((ocl_local)) int *LOC; // CHECK-OLD-DAG: [[NoAS:%[a-zA-Z0-9]+]] = alloca i32* // CHECK-NEW-DAG: [[NoAS:%[a-zA-Z0-9]+]] = alloca i32 addrspace(4)* int *NoAS; // CHECK-DAG: [[PRIV:%[a-zA-Z0-9]+]] = alloca i32* - __private int *PRIV; + __attribute__((ocl_private)) int *PRIV; bar(*GLOB); // CHECK-DAG: [[GLOB_LOAD:%[a-zA-Z0-9]+]] = load i32 addrspace(1)*, i32 addrspace(1)** [[GLOB]] @@ -121,19 +121,19 @@ void usages2() { // CHECK-DAG: [[PRIV_NUM:%[a-zA-Z0-9_]+]] = alloca i32* __attribute__((address_space(0))) int *PRIV_NUM2; // CHECK-DAG: [[PRIV_NUM2:%[a-zA-Z0-9_]+]] = alloca i32* - __private int *PRIV; + __attribute__((ocl_private)) int *PRIV; // CHECK-DAG: [[PRIV:%[a-zA-Z0-9_]+]] = alloca i32* __attribute__((address_space(1))) int *GLOB_NUM; // CHECK-DAG: [[GLOB_NUM:%[a-zA-Z0-9_]+]] = alloca i32 addrspace(1)* - __global int *GLOB; + __attribute__((ocl_global)) int *GLOB; // CHECK-DAG: [[GLOB:%[a-zA-Z0-9_]+]] = alloca i32 addrspace(1)* __attribute__((address_space(2))) int *CONST_NUM; // CHECK-DAG: [[CONST_NUM:%[a-zA-Z0-9_]+]] = alloca i32 addrspace(2)* - __constant int *CONST; + __attribute__((ocl_constant)) int *CONST; // CHECK-DAG: [[CONST:%[a-zA-Z0-9_]+]] = alloca i32 addrspace(2)* __attribute__((address_space(3))) int *LOCAL_NUM; // CHECK-DAG: [[LOCAL_NUM:%[a-zA-Z0-9_]+]] = alloca i32 addrspace(3)* - __local int *LOCAL; + __attribute__((ocl_local)) int *LOCAL; // CHECK-DAG: [[LOCAL:%[a-zA-Z0-9_]+]] = alloca i32 addrspace(3)* bar(*PRIV_NUM); diff --git a/clang/test/SemaSYCL/Inputs/sycl.hpp b/clang/test/SemaSYCL/Inputs/sycl.hpp index 3b2046756c30e..e05d90cb1c068 100644 --- a/clang/test/SemaSYCL/Inputs/sycl.hpp +++ b/clang/test/SemaSYCL/Inputs/sycl.hpp @@ -3,10 +3,6 @@ // Shared code for SYCL tests -#ifndef __SYCL_DEVICE_ONLY__ -#define __global -#endif - namespace cl { namespace sycl { namespace access { @@ -61,17 +57,17 @@ struct DeviceValueType; template struct DeviceValueType { - using type = __global dataT; + using type = __attribute__((ocl_global)) dataT; }; template struct DeviceValueType { - using type = __constant dataT; + using type = __attribute__((ocl_constant)) dataT; }; template struct DeviceValueType { - using type = __local dataT; + using type = __attribute__((ocl_local)) dataT; }; template void tmpl(T *t){} void usages() { - __global int *GLOB; - __private int *PRIV; + __attribute__((ocl_global)) int *GLOB; + __attribute__((ocl_private)) int *PRIV; __attribute__((address_space(3))) int *LOC; int *NoAS; diff --git a/clang/test/SemaSYCL/intel-fpga-local.cpp b/clang/test/SemaSYCL/intel-fpga-local.cpp index 80ec2f8042797..882a1e822fa21 100644 --- a/clang/test/SemaSYCL/intel-fpga-local.cpp +++ b/clang/test/SemaSYCL/intel-fpga-local.cpp @@ -406,7 +406,7 @@ void foo1() //expected-error@+1{{attribute only applies to local non-const variables and non-static data members}} [[intelfpga::max_private_copies(8)]] -__constant unsigned int ext_two[64] = { 1, 2, 3 }; +__attribute__((ocl_constant)) unsigned int ext_two[64] = { 1, 2, 3 }; void other2() {