P4 to Git Change 1191432 by yaxunl@yaxunl_stg_win50 on 2015/09/16 17:16:06

ECR #354633 - SPIR-V: Rename clCreateProgramWithIL as clCreateProgramWithILKHR and define it as an extension API.
	Add API to OCL 1.2/2.1.
	Add cl_khr_il_program extension.
	Fix SPIR-V conformance and ocltst.

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/amdocl.def.in#15 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/amdocl.map.in#18 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_context.cpp#44 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_icd.cpp#24 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_icd_amd.h#17 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_program.cpp#37 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_ext.h#9 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl.h#21 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_ext.h#16 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.1/CL/cl.h#3 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/icd/OpenCL.def.in#12 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/icd/icd_dispatch.c#28 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/icd/icd_dispatch.h#23 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/icd/icd_exports.map.in#8 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/cpu/cpusettings.cpp#30 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#252 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa/hsasettings.cpp#37 edit
... //depot/stg/opencl/drivers/opencl/tests/conformance/devel/2.0/test_conformance/spirv/main.cpp#7 edit
... //depot/stg/opencl/drivers/opencl/tests/conformance/devel/2.0/test_conformance/spirv/run_services.cpp#3 edit
... //depot/stg/opencl/drivers/opencl/tests/ocltst/module/spir/SPIRVBasic.cpp#3 edit


[ROCm/clr commit: e5b9796460]
Этот коммит содержится в:
foreman
2015-09-16 17:29:07 -04:00
родитель 5f95e8d5ff
Коммит 5fc1485c8f
12 изменённых файлов: 95 добавлений и 32 удалений
+3 -2
Просмотреть файл
@@ -103,7 +103,6 @@ clUnloadPlatformCompiler
#endif
#if (OPENCL_MAJOR >= 2)
clCreateProgramWithIL
clCreateCommandQueueWithProperties
clCreateSamplerWithProperties
clCreatePipe
@@ -157,6 +156,8 @@ aclDisassemble
aclInsertKernelStatistics
aclGetDeviceBinary
aclDumpBinary
#if (OPENCL_MAJOR > 2) || (OPENCL_MAJOR == 2 && OPENCL_MINOR >= 1)
clCreateProgramWithIL
#endif
#if !defined(OPENCL_MAINLINE)
#endif
+7 -1
Просмотреть файл
@@ -142,7 +142,6 @@ global:
#if (OPENCL_MAJOR >= 2)
OPENCL_2.0 {
global:
clCreateProgramWithIL;
clCreateCommandQueueWithProperties;
clCreateSamplerWithProperties;
clCreatePipe;
@@ -159,6 +158,13 @@ global:
} OPENCL_1.2;
#endif
#if (OPENCL_MAJOR > 2) || (OPENCL_MAJOR == 2 && OPENCL_MINOR >= 1)
OPENCL_2.1 {
global:
clCreateProgramWithIL;
} OPENCL_2.1;
#endif
ACL_0.8 {
global:
aclCompilerInit;
+3
Просмотреть файл
@@ -509,6 +509,9 @@ clGetExtensionFunctionAddress(const char* func_name)
CL_EXTENSION_ENTRYPOINT_CHECK(clCreateKeyAMD);
CL_EXTENSION_ENTRYPOINT_CHECK(clConvertImageAMD);
CL_EXTENSION_ENTRYPOINT_CHECK(clCreateBufferFromImageAMD);
#if cl_khr_il_program
CL_EXTENSION_ENTRYPOINT_CHECK(clCreateProgramWithILKHR);
#endif // cl_khr_il_program
break;
case 'D':
break;
+1 -1
Просмотреть файл
@@ -205,7 +205,7 @@ amd::ICDDispatchedObject::icdVendorDispatch_[] = {{
clGetKernelSubGroupInfoKHR,
clTerminateContextKHR,
clCreateProgramWithIL
clCreateProgramWithILKHR
}};
CL_API_ENTRY cl_int CL_API_CALL
+4 -4
Просмотреть файл
@@ -210,11 +210,11 @@ typedef cl_program (CL_API_CALL * clCreateProgramWithSource_fn)(
const size_t * /* lengths */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
typedef cl_program (CL_API_CALL * clCreateProgramWithIL_fn)(
typedef cl_program (CL_API_CALL * clCreateProgramWithILKHR_fn)(
cl_context /* context */,
const void * /* il */,
size_t /* length */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2;
typedef cl_program (CL_API_CALL * clCreateProgramWithBinary_fn)(
cl_context /* context */,
@@ -979,8 +979,8 @@ typedef struct _cl_icd_dispatch_table
clGetKernelSubGroupInfoKHR_fn GetKernelSubGroupInfoKHR;
clTerminateContextKHR_fn TerminateContextKHR;
/* cl_khr_spirv */
clCreateProgramWithIL_fn CreateProgramWithIL;
/* cl_khr_il_program */
clCreateProgramWithILKHR_fn CreateProgramWithILKHR;
} cl_icd_dispatch_table;
#ifdef __cplusplus
+1 -1
Просмотреть файл
@@ -194,7 +194,7 @@ RUNTIME_EXIT
*
* \version 1.0r33
*/
RUNTIME_ENTRY_RET(cl_program, clCreateProgramWithIL, (
RUNTIME_ENTRY_RET(cl_program, clCreateProgramWithILKHR, (
cl_context context,
const void *il,
size_t length,
+19
Просмотреть файл
@@ -480,6 +480,25 @@ typedef struct _cl_mem_ion_host_ptr
const cl_event * /*event_list*/,
cl_event * /*event*/) CL_EXT_SUFFIX__VERSION_1_2;
#endif /* CL_VERSION_1_2 */
#ifdef CL_VERSION_1_2
/*********************************
* cl_khr_il_program extension
*********************************/
#define cl_khr_il_program 1
extern CL_API_ENTRY cl_program CL_API_CALL
clCreateProgramWithILKHR(cl_context /* context */,
const void * /* strings */,
size_t /* lengths */,
cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_program
( CL_API_CALL * clCreateProgramWithILKHR_fn)(cl_context /* context */,
const void * /* strings */,
size_t /* lengths */,
cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_2;
#endif /* CL_VERSION_1_2 */
#ifdef __cplusplus
-6
Просмотреть файл
@@ -835,12 +835,6 @@ clCreateProgramWithSource(cl_context /* context */,
const size_t * /* lengths */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_program CL_API_CALL
clCreateProgramWithIL(cl_context /* context */,
const void * /* strings */,
size_t /* lengths */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_program CL_API_CALL
clCreateProgramWithBinary(cl_context /* context */,
cl_uint /* num_devices */,
+19
Просмотреть файл
@@ -482,6 +482,25 @@ typedef CL_API_ENTRY cl_int
void* /*param_value*/,
size_t* /*param_value_size_ret*/ ) CL_EXT_SUFFIX__VERSION_2_0;
#endif /* CL_VERSION_2_0 */
#ifdef CL_VERSION_2_0
/*********************************
* cl_khr_il_program extension
*********************************/
#define cl_khr_il_program 1
extern CL_API_ENTRY cl_program CL_API_CALL
clCreateProgramWithILKHR(cl_context /* context */,
const void * /* strings */,
size_t /* lengths */,
cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_2_0;
typedef CL_API_ENTRY cl_program
( CL_API_CALL * clCreateProgramWithILKHR_fn)(cl_context /* context */,
const void * /* strings */,
size_t /* lengths */,
cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_2_0;
#endif /* CL_VERSION_2_0 */
#ifdef __cplusplus
}
+7 -1
Просмотреть файл
@@ -844,7 +844,13 @@ clCreateProgramWithSource(cl_context /* context */,
const char ** /* strings */,
const size_t * /* lengths */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_program CL_API_CALL
clCreateProgramWithIL(cl_context /* context */,
const void * /* strings */,
size_t /* lengths */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_2_1;
extern CL_API_ENTRY cl_program CL_API_CALL
clCreateProgramWithBinary(cl_context /* context */,
cl_uint /* num_devices */,
+27 -14
Просмотреть файл
@@ -470,20 +470,6 @@ clCreateProgramWithSource(cl_context context,
errcode_ret);
}
CL_API_ENTRY cl_program CL_API_CALL
clCreateProgramWithIL(cl_context context,
const void * il,
size_t length,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0
{
KHR_ICD_VALIDATE_HANDLE_RETURN_HANDLE(context, CL_INVALID_CONTEXT);
return context->dispatch->clCreateProgramWithIL(
context,
il,
length,
errcode_ret);
}
CL_API_ENTRY cl_program CL_API_CALL
clCreateProgramWithBinary(cl_context context,
cl_uint num_devices,
@@ -1641,6 +1627,9 @@ clGetExtensionFunctionAddress(const char *function_name) CL_EXT_SUFFIX__VERSION_
CL_COMMON_EXTENSION_ENTRYPOINT_ADD(clTerminateContextKHR);
/* cl_khr_il_program */
CL_COMMON_EXTENSION_ENTRYPOINT_ADD(clCreateProgramWithILKHR);
// fall back to vendor extension detection
for (vendor = khrIcdState.vendors; vendor; vendor = vendor->next)
{
@@ -2563,3 +2552,27 @@ clTerminateContextKHR(
return context->dispatch->clTerminateContextKHR(context);
}
CL_API_ENTRY cl_program CL_API_CALL
clCreateProgramWithILKHR(cl_context context,
const void * il,
size_t length,
cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_2
{
KHR_ICD_VALIDATE_HANDLE_RETURN_HANDLE(context, CL_INVALID_CONTEXT);
return context->dispatch->clCreateProgramWithIL(context, il, length,
errcode_ret);
}
//ToDo: change CL_API_SUFFIX__VERSION_2_0 to CL_API_SUFFIX__VERSION_2_1
// after switching to OpenCL 2.1
CL_API_ENTRY cl_program CL_API_CALL
clCreateProgramWithIL(cl_context context,
const void * il,
size_t length,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_2_0
{
KHR_ICD_VALIDATE_HANDLE_RETURN_HANDLE(context, CL_INVALID_CONTEXT);
return context->dispatch->clCreateProgramWithIL(context, il, length,
errcode_ret);
}
+4 -2
Просмотреть файл
@@ -272,11 +272,13 @@ typedef CL_API_ENTRY cl_program (CL_API_CALL *KHRpfn_clCreateProgramWithSource)(
const size_t * lengths,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
//ToDo: Change CL_API_SUFFIX__VERSION_2_0 to CL_API_SUFFIX__VERSION_2_1
// after switching to OpenCL 2.1.
typedef CL_API_ENTRY cl_program (CL_API_CALL *KHRpfn_clCreateProgramWithIL)(
cl_context context,
const void * il,
size_t length,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_2_0;
typedef CL_API_ENTRY cl_program (CL_API_CALL *KHRpfn_clCreateProgramWithBinary)(
cl_context context,
@@ -1418,7 +1420,7 @@ struct KHRicdVendorDispatchRec
KHRpfn_clTerminateContextKHR clTerminateContextKHR;
/* cl_khr_spirv */
/* OpenCL 2.1 */
KHRpfn_clCreateProgramWithIL clCreateProgramWithIL;
};