From 0eebe2536c8e76cd20867d1ca00ba4735736f629 Mon Sep 17 00:00:00 2001 From: Luo Xionghu Date: Sat, 23 Apr 2016 00:37:18 +0800 Subject: standalone utest for unified OpenCL implementation. use the variable NOT_BUILD_STAND_ALONE_UTEST to control the build type: for beignet build, set it to 1; for stand alone build, do NOT need set it. remove all clXXXIntel extension call and such kind of tests since we intend to provide the unit test independently for viariant OpenCL implementation; replace the clMapBufferIntel/clMapBufferGTTIntel with clEnqueueMapBuffer/clEnqueueMapImage; link the utest binary to libOpenCL to follow the icd standard; remove the useless env in setenv.sh since we need make install the package after build. v2: fix the indent error; use function pointer for extesion case like vme and libva since we link to libOpenCL; v3: builtin_kernel_block_motion_estimate_intel released kernel twice; v4: find OpenCL library for standalone utest and link to libcl for not standalone utest; check default variables in setenv.sh whether empty before use. Signed-off-by: Luo Xionghu Reviewed-by: Yang Rong --- utests/runtime_flat_address_space.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'utests/runtime_flat_address_space.cpp') diff --git a/utests/runtime_flat_address_space.cpp b/utests/runtime_flat_address_space.cpp index 9b8bece6..6430edb1 100644 --- a/utests/runtime_flat_address_space.cpp +++ b/utests/runtime_flat_address_space.cpp @@ -53,7 +53,7 @@ main(int argc, char *argv[]) NULL); // Be sure that everything run fine - dst_buffer = (int *) clMapBufferIntel(dst[j], &status); + dst_buffer = (int *)clEnqueueMapBuffer(queue, dst[j], CL_TRUE, CL_MAP_READ, 0, sizeof(int)*n, 0, NULL, NULL, &status); if (status != CL_SUCCESS) goto error; for (uint32_t i = 0; i < n; ++i) @@ -61,13 +61,11 @@ main(int argc, char *argv[]) fprintf(stderr, "run-time flat address space failed\n"); exit(-1); } - OCL_CALL (clUnmapBufferIntel, dst[j]); + clEnqueueUnmapMemObject(queue, dst[j], dst_buffer, 0, NULL, NULL); } for (uint32_t j = 0; j < 24; ++j) OCL_CALL (clReleaseMemObject, dst[j]); cl_test_destroy(); - printf("%i memory leaks\n", clReportUnfreedIntel()); - assert(clReportUnfreedIntel() == 0); error: return status; -- cgit v1.2.3