From 8909ed64ff6832412961eee24e8eb5c4e91c2856 Mon Sep 17 00:00:00 2001 From: bsegovia Date: Thu, 4 Aug 2011 03:22:41 +0000 Subject: [PATCH] Cleaned and simplified all test kernels and codes. Now everything is inside one reportory and kernels are compiled and sorted per generation --- include/CL/cl_intel.h | 4 ++++ kernels/Makefile | 2 +- src/cl_api.c | 6 ++++++ src/cl_device_id.c | 17 +++++++++++++++++ src/cl_device_id.h | 3 +++ 5 files changed, 31 insertions(+), 1 deletion(-) diff --git a/include/CL/cl_intel.h b/include/CL/cl_intel.h index 7a2b51d..34f3728 100644 --- a/include/CL/cl_intel.h +++ b/include/CL/cl_intel.h @@ -52,6 +52,10 @@ clIntelUnpinBuffer(cl_mem); extern CL_API_ENTRY cl_int CL_API_CALL clIntelSetReportBuffer(cl_command_queue, cl_mem); +/* Get the generation of the Gen device (used to load the proper binary) */ +extern CL_API_ENTRY cl_int CL_API_CALL +clIntelGetGenVersion(cl_device_id device, cl_int *ver); + #ifdef __cplusplus } #endif diff --git a/kernels/Makefile b/kernels/Makefile index 0fde916..3990f04 100644 --- a/kernels/Makefile +++ b/kernels/Makefile @@ -2,7 +2,7 @@ GEN6 := $(patsubst %.cl,%.gen6.bin,$(wildcard *.cl)) GEN7 := $(patsubst %.cl,%.gen7.bin,$(wildcard *.cl)) %.gen6.bin: %.cl - wine ../bin/TC_Tester.exe -f $< -dev gen7 -in cl_text -out dev_bin + wine ../bin/TC_Tester.exe -f $< -dev gen6 -in cl_text -out dev_bin %.gen7.bin: %.cl wine ../bin/TC_Tester.exe -f $< -dev gen7 -in cl_text -out dev_bin diff --git a/src/cl_api.c b/src/cl_api.c index 3defcae..dee6785 100644 --- a/src/cl_api.c +++ b/src/cl_api.c @@ -1107,6 +1107,12 @@ error: } cl_int +clIntelGetGenVersion(cl_device_id device, cl_int *ver) +{ + return cl_device_get_version(device, ver); +} + +cl_int clFulsimSetOutputBuffer(cl_command_queue queue, cl_mem mem) { cl_int err = CL_SUCCESS; diff --git a/src/cl_device_id.c b/src/cl_device_id.c index b617a4f..219958a 100644 --- a/src/cl_device_id.c +++ b/src/cl_device_id.c @@ -231,3 +231,20 @@ cl_get_device_info(cl_device_id device, }; } +LOCAL cl_int +cl_device_get_version(cl_device_id device, cl_int *ver) +{ + if (UNLIKELY(device != &intel_snb_gt1_device && + device != &intel_snb_gt2_device && + device != &intel_ivb_gt1_device && + device != &intel_ivb_gt2_device)) + return CL_INVALID_DEVICE; + if (ver == NULL) + return CL_SUCCESS; + if (device == &intel_snb_gt1_device || device == &intel_snb_gt2_device) + *ver = 6; + else + *ver = 7; + return CL_SUCCESS; +} + diff --git a/src/cl_device_id.h b/src/cl_device_id.h index 83f2afd..3b2f1be 100644 --- a/src/cl_device_id.h +++ b/src/cl_device_id.h @@ -107,5 +107,8 @@ extern cl_int cl_get_device_info(cl_device_id device, void * param_value, size_t * param_value_size_ret); +/* Returns the Gen device ID */ +extern cl_int cl_device_get_version(cl_device_id device, cl_int *ver); + #endif /* __CL_DEVICE_ID_H__ */ -- 2.7.4