Skip to content

Commit d8aceb1

Browse files
committed
Check default addrspace used for non cuda/hip
Signed-off-by: JackAKirk <[email protected]>
1 parent 9c15eed commit d8aceb1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sycl/test/check_device_code/device_global_const.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// RUN: %clangxx -fsycl -fsycl-device-only %if cuda %{ -fsycl-targets=nvptx64-nvidia-cuda %} %if hip-amd %{ -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx90a %} -S -emit-llvm %s -o - | FileCheck %s %if cuda || hip-amd %{ --check-prefixes=CHECK-CONST %}
22

3-
// Tests that const T device_global uses const address space for cuda/hip
3+
// Tests that const T device_global uses const address space for cuda/hip and
4+
// global address space otherwise
45

56
#include <sycl/sycl.hpp>
67

@@ -13,6 +14,7 @@ int main() {
1314
queue Q;
1415
Q.single_task([]() {
1516
// CHECK-CONST: (ptr addrspace(4) @DeviceGlobalVar
17+
// CHECK: (ptr addrspace(1) @DeviceGlobalVar
1618
volatile int ReadVal = DeviceGlobalVar;
1719
});
1820
return 0;

0 commit comments

Comments
 (0)