mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Add support for cl_khr_il_program extension
This commit is contained in:
committed by
Alastair Murray
parent
3730bce4e8
commit
adec8f9412
@@ -665,11 +665,32 @@ static int create_single_kernel_helper_create_program_offline(cl_context context
|
||||
|
||||
size_t length = modifiedKernelBuf.size();
|
||||
log_info("offlineCompiler: clCreateProgramWithSource replaced with clCreateProgramWithIL\n");
|
||||
if (gCoreILProgram) {
|
||||
*outProgram = clCreateProgramWithIL(context, &modifiedKernelBuf[0], length, &error);
|
||||
}
|
||||
else {
|
||||
cl_platform_id platform;
|
||||
error = clGetDeviceInfo(device, CL_DEVICE_PLATFORM, sizeof(cl_platform_id), &platform, NULL);
|
||||
print_error(error, "clGetDeviceInfo for CL_DEVICE_PLATFORM failed");
|
||||
clCreateProgramWithILKHR_fn clCreateProgramWithILKHR = NULL;
|
||||
|
||||
clCreateProgramWithILKHR = (clCreateProgramWithILKHR_fn)clGetExtensionFunctionAddressForPlatform(platform, "clCreateProgramWithILKHR");
|
||||
if (clCreateProgramWithILKHR == NULL)
|
||||
{
|
||||
log_error("ERROR: clGetExtensionFunctionAddressForPlatform failed\n");
|
||||
return -1;
|
||||
}
|
||||
*outProgram = clCreateProgramWithILKHR(context, &modifiedKernelBuf[0], length, &error);
|
||||
}
|
||||
|
||||
*outProgram = clCreateProgramWithIL(context, &modifiedKernelBuf[0], length, &error);
|
||||
if (*outProgram == NULL || error != CL_SUCCESS)
|
||||
{
|
||||
print_error(error, "clCreateProgramWithIL failed");
|
||||
if (gCoreILProgram) {
|
||||
print_error(error, "clCreateProgramWithIL failed");
|
||||
}
|
||||
else {
|
||||
print_error(error, "clCreateProgramWithILKHR failed");
|
||||
}
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user