summaryrefslogtreecommitdiff
path: root/src/cl_device_id.c
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@intel.com>2015-07-15 09:49:01 +0800
committerYang Rong <rong.r.yang@intel.com>2015-07-15 15:05:33 +0800
commit69ef089d96c79ad147874ffa87fdda00d031f7ff (patch)
treebaa48106b74dd94554d70d76c4f73326bbd7e482 /src/cl_device_id.c
parent6b93aea02873edeabb151a017fb2e349bda333e1 (diff)
runtime: Need to separate atomic in L3 test and SLM test in self_test().
On HSW, if we use default 4.0.x kernel without the i915.enable_ppgtt=2 boot argument, then the atomic in L3 will not work and the SLM will not work neither. We need to test atomic in L3 firstly, if it fails we need to test SLM again. Otherwise, beignet will not give any error/warning information for both atomic in L3 and SLM not working case. v2: shold set the atomic test result before the second round SLM test. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Reviewed-by: "Luo, Xionghu" <xionghu.luo@intel.com>
Diffstat (limited to 'src/cl_device_id.c')
-rw-r--r--src/cl_device_id.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/cl_device_id.c b/src/cl_device_id.c
index f772278c..f351f857 100644
--- a/src/cl_device_id.c
+++ b/src/cl_device_id.c
@@ -564,7 +564,7 @@ skl_gt4_break:
* SELF_TEST_ATOMIC_FAIL: for hsw enqueue kernel failure to not enable atomics in L3.
* SELF_TEST_OTHER_FAIL: other fail like runtime API fail.*/
LOCAL cl_self_test_res
-cl_self_test(cl_device_id device)
+cl_self_test(cl_device_id device, cl_self_test_res atomic_in_l3_flag)
{
cl_int status;
cl_context ctx;
@@ -587,6 +587,7 @@ cl_self_test(cl_device_id device)
return ret;
tested = 1;
ctx = clCreateContext(NULL, 1, &device, NULL, NULL, &status);
+ cl_driver_set_atomic_flag(ctx->drv, atomic_in_l3_flag);
if (status == CL_SUCCESS) {
queue = clCreateCommandQueue(ctx, device, 0, &status);
if (status == CL_SUCCESS) {
@@ -611,10 +612,13 @@ cl_self_test(cl_device_id device)
printf("Beignet: self-test failed: (3, 7, 5) + (5, 7, 3) returned (%i, %i, %i)\n"
"See README.md or http://www.freedesktop.org/wiki/Software/Beignet/\n",
test_data[0], test_data[1], test_data[2]);
+
}
}
} else{
ret = SELF_TEST_ATOMIC_FAIL;
+ // Atomic fail need to test SLM again with atomic in L3 feature disabled.
+ tested = 0;
}
}
}
@@ -643,8 +647,13 @@ cl_get_device_ids(cl_platform_id platform,
/* Do we have a usable device? */
device = cl_get_gt_device();
if (device) {
- cl_self_test_res ret = cl_self_test(device);
- device->atomic_test_result = ret;
+ cl_self_test_res ret = cl_self_test(device, SELF_TEST_PASS);
+ if (ret == SELF_TEST_ATOMIC_FAIL) {
+ device->atomic_test_result = ret;
+ ret = cl_self_test(device, ret);
+ printf("Beignet: warning - disable atomic in L3 feature.\n");
+ }
+
if(ret == SELF_TEST_SLM_FAIL) {
int disable_self_test = 0;
// can't use BVAR (backend/src/sys/cvar.hpp) here as it's C++