aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-06-30Update TODOHEADmasterGil Pitney
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2016-06-30Document patch to fix bug in test_compile Khronos conformance testGil Pitney
With this patch (taken from Khronos OpenCL v2.0 test suite) the test_compiler conformance test should pass at 100%. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2016-06-29Add in the logic to resetDeviceDependent upon recompiling a built programGil Pitney
Previously, this was ifdef'd out, but the logic is needed to ensure the program is actually rebuilt if the client rebuild the same program with different user options. This enables the following 3 test_compiler Khronos test cases to pass: % test_compiler options_build_macro options_build_macro_existence options_include_directory Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2016-06-29Fixed erroneous determination of number of kernels associated with a programGil Pitney
Previously, CL_INVALID_OPERATION was being returned when trying to compile a binary loaded program. This is fixed, enabling now all 72 of the v1.2 Khronos API conformance tests to pass. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2016-06-29Fix the tests kernel sanity test to enqueue the right kernel2.Gil Pitney
Previously, the sanity test was assuming a certain order in the kernel list returned from clCreateKernelsInProgram(), which order is not guarranteed, and which changed due to a previous commit (bug fix). Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2016-06-29Remove the "resurrection" method in kernel create/delete logicGil Pitney
This removes maintentance of the kernelReleasedList, but maintains the kernelList of the Program object. The logic around resurrecting previously released kernels was not quite correct, and causing issues in kernel object reference counting. This commit also ensures clReleaesKenrel() deletes the kernel, and erases the kernel from the kernelList. This fix causes no regressions in the Khronos test cases, but also fixes a JIT memory leak issue due to undeleted Program objects upon clReleaseProgram(). Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2016-06-29Fixes to sanity test case 'tests kernel'Gil Pitney
Previously, an event was not being released in test_compiled_kernel() test case, causing an imbalance in program object reference count. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2016-06-29Added notes on reason for failed test_compiler Khronos tests.Gil Pitney
I assert that some Khronos v1.2 tests are violating the v1.2 spec. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2016-06-29Merge of select changes from TI OpenCL 01.01.08.03 from ↵TI_01_01_08_03_MergeGil Pitney
git.ti.com/ti-opencl/host Including: - Use of the Loki library v 0.1.7 for C++ Singleton implementation. - Updated Platform object to be a Singleton class instance. - Better handling of MemObject management with concurrent threads. - Events: added CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST error code. - MapImageEvent() fixes. - KernelEvent() fixes around retaining/releasing objects. - CopyBufferRectEvent() fixes. - ReadWriteBufferRectEvent() fixes. Revalidating Shamrock with these changes resulted in 12 more Khronos conformance tests passing in test_basic, test_buffers, and test_events, and no regressions. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-10-07Update README and TODOicdGil Pitney
ICD now supported, so that's no longer a TODO. Also, need to install opencl-headers package, as the OpenCL headers are no longer copied from this repo. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-10-02ICD: Update Sampler objects to be ICD compatible.Gil Pitney
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-10-02ICD: Update MemObject objects to be ICD compatible.Gil Pitney
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-10-01ICD: Update Event objects to be ICD compatible.Gil Pitney
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-10-01ICD: Update CommandQueue objects to be ICD compatible.Gil Pitney
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-09-30ICD: Update Kernel objects to be ICD compatible.Gil Pitney
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-09-30ICD: Update Program objects to be ICD compatible.Gil Pitney
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-09-30ICD: Update Context objects to be ICD compatible.Gil Pitney
This was validated by running the sanity tests, and the Khronos conformance tests without an ICD loader; then installing the Khronos ICD loader, and running that subset of conformance tests that would just invoke OpenCL Context APIs. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-09-29ICD: Update Platform and DeviceInterface objects to be ICD compatible.Gil Pitney
Use the ICD templates to: a) Embed the dispatch table pointer into the object; and b) Convert between OpenCL API objects and their internal Coal namespace representations. This involved explicitly up/down casting whereever there was an explicit or implicit cast between a cl_<object> type and a Coal::<object> type. This was validated by running the sanity tests, and the Khronos conformance tests without an ICD loader; then installing the Khronos ICD loader, and running that subset of conformance tests that would just invoke Platform and Device APIs. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-09-29ICD: Update Dispatch table and add OpenCL object type conversion templatesGil Pitney
Update the dispatch table to match the OCL 1.2 disptach table of the file ICD loader, which is available from the Khronos website: www.khronos.org/registry/cl/specs/opencl-icd-1.2.11.0 Also, define templates to enable conversion between Coal namespace internal C++ objects and OpenCL C API objects, containing the dispatch table pointer as the first pointer field, as expected by the Khronos ICD loader. This template design is based on the solution employed by Francisco Jerez in the clover state tracker of Mesa: http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/state_trackers/clover/core/object.hpp with some simplifications. For example, validation is done in shamrock using isA() methods, and not in the templates. Also conversion of lists is done simply, using for loops, rather than maps and vectors. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-07-29Explicitly return CL_INVALID_VALUE for CL_KERNEL_GLOBAL_WORK_SIZE caseshamrock_v1.2ocl_1_2_fixesGil Pitney
Per the v1.2 spec, for clGetKernelWorkGroupInfo(), CL_KERNEL_GLOBAL_WORK_SIZE: "If device is not a custom device or kernel is not a built-in kernel, clGetKernelArgInfo returns the error CL_INVALID_VALUE." Since the CPU is not a custom device, and has no built-in kernels, then the return value of CL_INVALID_VALUE is correct. This reverts commit 668bdd17cadc838a8bc165a0f222e31c7b6777a7, but as a result may cause an error in piglit testing, which that commit was meant to resolve. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-07-29To handle the CL_KERNEL_GLOBAL_WORK_SIZE caseShow Liu
2015-07-29To check the device is NULL or not to avoid the crash issueShow Liu
2015-07-28Update clBuildProgram() to return correct error code if compile fails.Gil Pitney
Previously, clBuildProgram() was returning CL_COMPILE_PROGRAM_FAILURE instead of CL_BUILD_PROGRAM_FAILURE when the compile method, called from the build method, failed. This was caught by a piglit v1.2 test: "Failed (error code: CL_COMPILE_PROGRAM_FAILURE): Trigger CL_BUILD_PROGRAM_FAILURE if there is a failure to build the program executable." Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-07-28Updated README, ISSUES, TODO files for v1.2 release of ShamrockGil Pitney
Also updated detailed analysis of Khronos failing tests for posterity. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-07-27Update clGetDeviceInfo() for MAX_CONSTANT_ARGS and BUFFER_SIZEGil Pitney
Previously, the values of: CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE and CL_DEVICE_MAX_CONSTANT_ARGS were so large as to cause the Khronos tests to run out of memory and crash LLVM with an assertion. Now, these values have been reduced to the minimum allowed by the spec. This enables the Khronos test: %test_api min_max_constant_args to PASS reliably. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-07-24Updated list of 'basic' Khronos v1.2 tests still failingGil Pitney
One previously failing test now passes, due to an updated LLVM, and one new test is failing. Analysis provided. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-07-24Return correct platform id for CPUDevice in call to clGetDeviceInfo()Gil Pitney
Previously, this was returning zero! This allows the Khronos tests: % test_api create_context_from_type % test_api platform_extensions to PASS. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-07-24Retain MemObjects for buffer args in KernelEvent creation.Gil Pitney
It is necessary to retain any buffers in case the client releases memory buffers for kernel objects during kernel execution. In fact, the Khronos test: % test_api release_during_execute test does just that! This patch allows that test to pass. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-07-22Ensure CL_DEVICE_MAX_MEM_ALLOC_SIZE info function returns 1/4 of global memGil Pitney
Per the v1.2 spec, minimum size for maximum memory allocatable must be 1/4 the size of CL_DEVICE_GLOBAL_MEM_SIZE. This enables the Khronos test % test_api min_max_mem_alloc_size to PASS. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-07-22Add new v1.2 cl_mem flags to Buffer and SubBuffer creation functions.Gil Pitney
The flags: CL_MEM_HOST_WRITE_ONLY | CL_MEM_HOST_READ_ON | CL_MEM_HOST_NO_ACCESS were missing in the validation of flags to clCreateBuffer() and clCreateSubBuffer(). In addition, sub-buffer creation functions needed logic to conditionally inherit flags from the parent buffer. This patch enables the Khronos conformance test: % test_api get_buffer_info to PASS. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-07-22Update Kernel::reqdWorkGroupSize() to search all meta node operands.Gil Pitney
With an update of LLVM to 3.6+, the reqd_work_group_size attribute is no longer sitting in the first operand position of the function's meta data node. It now can be anywhere. This patch iterates through all the metanode operands searching for the reqd_work_group_size attribute. This enables the Khronos test: % test_api kernel_required_group_size to PASS. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-07-20Reduce clGetDeviceInfo() CL_DEVICE_MAX_PARAMTER_SIZE to the minimum valueGil Pitney
Previous value was 64Kb for max allowable size of parameters to pass to a kernel. This was causing Khronos tests to crash. Now, set to a more sane size: 1024 bytes. This enables the Khronos test: % test_api min_max_parameter_size to PASS. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-07-20BufferEvent::isSubBufferAligned(): test for null buffer.Gil Pitney
It is possible that the callee is passing a null buffer, which is a valid value per the v1.2 spec for a kernel argument. This patch enables the v1.2 Khronos test: % test_api null_buffer_arg to PASS. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-07-20Test for kernel attribute vec_type_hint during Kernel::fillArgsInfo()Gil Pitney
This prevents a crash, and allows the Khronos test: % test_basic vec_type_hint to pass. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-07-20Update comment in clBuildProgram()Gil Pitney
Include % test_api binary_create in the list of Khronos tests that violate the spec. See comment in source code. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-07-17Added new v1.2 kernel preprocessor macro: "__OPENCL_C_VERSION__=120"Gil Pitney
This enables the Khronos v1.2 % test_basic kernel_preprocessor_macros test to pass. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-07-17Updated README for OpenCL v1.2Gil Pitney
Updated "make test" sanity results. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-07-17clRetainDevice(): return CL_SUCCESSGil Pitney
Minor bug fix, caught thanks to compiler warning. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-07-14Remove 64 bit atomics extensions from CPU Device.ocl_1_2Gil Pitney
The extension is optional, partial support exists in atomic.cl, so can be added back if that becomes a requirement. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-07-14fixed the crash issue for convert builtin functionShow Liu
GP: Amended to include cpu.h instead of clc.h, which defines abs() in terms of __builtin_abs().
2015-07-09Implemented CMake check for opencl-headers minium version 1.2 installedGil Pitney
Previously, it was assumed the OpenCL headers version 1.2 were installed, and if not, the build failed. Now CMake will check this and error out before the build. OpenCL header versions greater than 1.2 should also be acceptable. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-07-02Added the declaration for the 64 bits atomic operationsShow Liu
2015-07-02Fixed the atomic operations failed on 64 bits argument and discard the ↵Show Liu
whitespace
2015-07-02Fixed the atomic operation crash issuesShow Liu
2015-06-30Implement clEnqueueMigrateMemObjects() v1.2 APIGil Pitney
This implementation passes the Khronos test_buffer_migrate test of the buffers test. However, a real test requires devices of different memory affinities, between which to migrate the buffers, which in the case of a CPUDevice only implementation on heterogenous cores, we don't currently have. Nevertheless, this patch implements the API, and the backend has a nominal implementation which will pre-allocate device buffers when called. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-06-26Tixed the mad_sat() builtin function crash issueShow Liu
2015-06-24Sub-devices inherit the parent's kernel and program device dependent structs.Gil Pitney
This implements an aspect of the clCreateSubDevices() API, per the v1.2 spec: "A program binary (compiled binary, library binary or executable binary) built for a parent device can be used by all its sub-devices. If a program binary has not been built for a sub-device, the program binary associated with the parent device will be used." Previously, each program or kernel object was created for a device. If a device was paritioned into sub-devices, the sub-devices may not have had an associated program/kernel object (unless one was explicitly built). Now, when shamrock queries a device for a kernel or program, it will search the device hierarchy and look for a parent device for which a program/kernel object may have been created. This patch enables the Khronos v1.2 test_device_partition to PASS. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-06-23fixed the mul_hi() builtin function crash issueShow Liu
2015-06-23fixed for rotate() crash issue when argument is uint typeShow Liu
2015-06-23added "-cl-std=CL1.2" cflags supportShow Liu