Skip to content

Commit 6c50b82

Browse files
authored
Use device_arch when generating native code instead of hardcoded 'pvc' (#4532)
Signed-off-by: Anatoly Myachev <[email protected]>
1 parent f744146 commit 6c50b82

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

third_party/intel/backend/compiler.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ def make_llir(src, metadata, options):
380380
return ret
381381

382382
@staticmethod
383-
def make_spv(src, metadata, options):
383+
def make_spv(src, metadata, options, device_arch):
384384
spirv, name = intel.translate_to_spirv(src)
385385
metadata["name"] = name
386386
if options.grf_mode == 'small':
@@ -414,8 +414,8 @@ def make_spv(src, metadata, options):
414414
fbin = fsrc.name + '.o'
415415

416416
ocloc_cmd = [
417-
'ocloc', 'compile', '-file', fsrc.name, '-o', fbin, '-spirv_input', '-device', 'pvc', '-options',
418-
metadata["build_flags"] + shader_dump_opt
417+
'ocloc', 'compile', '-file', fsrc.name, '-o', fbin, '-spirv_input', '-device', device_arch,
418+
'-options', metadata["build_flags"] + shader_dump_opt
419419
]
420420

421421
try:
@@ -468,7 +468,7 @@ def add_stages(self, stages, options, language):
468468
elif language == Language.GLUON:
469469
stages["ttgir"] = lambda src, metadata: self.ttgir_opt(src, metadata, options)
470470
stages["llir"] = lambda src, metadata: self.make_llir(src, metadata, options)
471-
stages["spv"] = lambda src, metadata: self.make_spv(src, metadata, options)
471+
stages["spv"] = lambda src, metadata: self.make_spv(src, metadata, options, self.device_arch)
472472

473473
@functools.lru_cache()
474474
def hash(self):

0 commit comments

Comments
 (0)