@@ -584,12 +584,12 @@ static int linkWithLLVMLink(cl_program Program, cl_uint DeviceI,
584
584
if (Err != CL_SUCCESS)
585
585
return Err;
586
586
587
- Err = pocl_convert_bitcode_to_spirv (ProgramBcPathTemp,
588
- nullptr , 0 ,
589
- Program, DeviceI,
590
- 1 , // useIntelExt
591
- ProgramSpvPathTemp,
592
- nullptr , nullptr );
587
+ cl_device_id Dev = Program-> devices [DeviceI];
588
+ Level0Device *Device = static_cast <Level0Device *>(Dev-> data );
589
+ Err = pocl_convert_bitcode_to_spirv (
590
+ ProgramBcPathTemp, nullptr , 0 , Program, DeviceI,
591
+ 1 , // useIntelExt
592
+ ProgramSpvPathTemp, nullptr , nullptr , Device-> getSupportedSpvVersion () );
593
593
594
594
POCL_RETURN_ERROR_ON ((Err != 0 ), CL_BUILD_PROGRAM_FAILURE,
595
595
" llvm-spirv exited with nonzero code\n " );
@@ -643,14 +643,12 @@ int pocl_level0_build_source(cl_program Program, cl_uint DeviceI,
643
643
if (Err != CL_SUCCESS)
644
644
return Err;
645
645
646
- Err = pocl_convert_bitcode_to_spirv (nullptr ,
647
- (char *)Program->binaries [DeviceI],
648
- Program->binary_sizes [DeviceI],
649
- Program, DeviceI,
650
- 1 , // useIntelExt
651
- ProgramSpvPathTemp,
652
- &OutputBinary,
653
- &OutputBinarySize);
646
+ Err = pocl_convert_bitcode_to_spirv (
647
+ nullptr , (char *)Program->binaries [DeviceI],
648
+ Program->binary_sizes [DeviceI], Program, DeviceI,
649
+ 1 , // useIntelExt
650
+ ProgramSpvPathTemp, &OutputBinary, &OutputBinarySize,
651
+ Device->getSupportedSpvVersion ());
654
652
POCL_RETURN_ERROR_ON ((Err != 0 ), CL_BUILD_PROGRAM_FAILURE,
655
653
" llvm-spirv exited with nonzero code\n " );
656
654
@@ -773,13 +771,14 @@ int pocl_level0_build_binary(cl_program Program, cl_uint DeviceI,
773
771
" the binary supplied to level0 driver is "
774
772
" not a recognized binary type\n " );
775
773
776
- Err = pocl_convert_bitcode_to_spirv (ProgramBcPathTemp,
777
- (char *)Program->binaries [DeviceI],
778
- Program->binary_sizes [DeviceI],
779
- Program, DeviceI,
780
- 1 , // useIntelExt
781
- ProgramSpvPathTemp,
782
- &OutputBinary, &OutputBinarySize);
774
+ cl_device_id Dev = Program->devices [DeviceI];
775
+ Level0Device *Device = static_cast <Level0Device *>(Dev->data );
776
+ Err = pocl_convert_bitcode_to_spirv (
777
+ ProgramBcPathTemp, (char *)Program->binaries [DeviceI],
778
+ Program->binary_sizes [DeviceI], Program, DeviceI,
779
+ 1 , // useIntelExt
780
+ ProgramSpvPathTemp, &OutputBinary, &OutputBinarySize,
781
+ Device->getSupportedSpvVersion ());
783
782
POCL_RETURN_ERROR_ON ((Err != 0 ), CL_BUILD_PROGRAM_FAILURE,
784
783
" failed to compile BC -> SPV\n " );
785
784
Program->program_il = OutputBinary;
0 commit comments