Skip to content

Commit 435636f

Browse files
authored
Merge pull request #186 from Pennycook/bugfix/sycl-nvptx64
Add definition of sycl-nvptx64-nvidia-cuda pass
2 parents e4b1d6c + ea60c67 commit 435636f

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

codebasin/compilers/intel.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,8 @@ modes = ["sycl"]
5050
name = "sycl-spir64_fpga"
5151
defines = ["__SYCL_DEVICE_ONLY__", "__SPIR__", "__SPIRV__"]
5252
modes = ["sycl"]
53+
54+
[[compiler.icx.passes]]
55+
name = "sycl-nvptx64-nvidia-cuda"
56+
defines = ["__SYCL_DEVICE_ONLY__", "__NVPTX__"]
57+
modes = ["sycl"]

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)