Skip to content

Commit 96f846e

Browse files
committed
Add regression test for SYCL on NVIDIA
"nvptx64-nvidia-cuda" should be a valid target. Signed-off-by: John Pennycook <john.pennycook@intel.com>
1 parent e4b1d6c commit 96f846e

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

tests/compilers/test_compilers.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def test_intel_targets(self):
117117
argv = [
118118
"icpx",
119119
"-fsycl",
120-
"-fsycl-targets=spir64,spir64_x86_64",
120+
"-fsycl-targets=spir64,spir64_x86_64,nvptx64-nvidia-cuda",
121121
"-fopenmp",
122122
"test.cpp",
123123
]
@@ -129,7 +129,12 @@ def test_intel_targets(self):
129129
pass_names = {p.pass_name for p in passes}
130130
self.assertCountEqual(
131131
pass_names,
132-
{"default", "sycl-spir64", "sycl-spir64_x86_64"},
132+
{
133+
"default",
134+
"sycl-spir64",
135+
"sycl-spir64_x86_64",
136+
"sycl-nvptx64-nvidia-cuda",
137+
},
133138
)
134139

135140
for p in passes:
@@ -145,6 +150,12 @@ def test_intel_targets(self):
145150
"__SPIR__",
146151
"__SPIRV__",
147152
]
153+
elif p.pass_name == "sycl-nvptx64-nvidia-cuda":
154+
expected = [
155+
"SYCL_LANGUAGE_VERSION",
156+
"__SYCL_DEVICE_ONLY__",
157+
"__NVPTX__",
158+
]
148159
self.assertCountEqual(p.defines, expected)
149160

150161
def test_nvcc(self):

0 commit comments

Comments
 (0)