aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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
2015-06-17clCreateProgramWithBinary(): fix memory leak.Gil Pitney
Memory for a temporary array of context devices was not getting freed. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-06-16fixed the upsample() builtin function crash issueShow Liu
2015-06-16fiexed for clz() builtin function crash issueShow Liu
2015-06-16Fix clGetKernelWorkGroupInfo per v1.2 specGil Pitney
This function now implements this aspect of the spec for this function: "CL_INVALID_DEVICE if device is not in the list of devices associated with kernel..." Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-06-12Allow CPUBuffers for CPUDevices to share copied host pointer dataGil Pitney
Device data allocated for Buffer objects allocated via clCreateBuffer() using the CL_MEM_COPY_HOST_PTR flag for CPUDevices should be allocated only once in global device memory, and shared between the CPUDevices. Previously, shamrock was creating a brand new allocation for each device buffer, for the same MemObject. This was causing the test_device_partition Khronos test to fail (for device fission). This is now fixed, by enabling sharing of device data. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-06-05clCreateSubDevices(): Return CL_DEVICE_PARTITION_FAILED if numCPUs() == 1Gil Pitney
If a sub-device cannot be further sub-divided, the v1.2 spec allows the implementation to return CL_DEVICE_PARTITION_FAILED, or CL_INVALID_VALUE depending on one's interpretation. The Khronos v1.2 device_partition test fails in either case (which appears to be a bug). The Khronos v2.0 device_partition test was modified to accept the return value of CL_DEVICE_PARTITION_FAILED, which is a logical fix. This patch allows a similarly modified (fixed) Khronos v1.2 test to pass the test subroutine code which recursively subdivides devices. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2015-06-05fixed the sub_sat() builin function crash issueShow Liu
2015-06-05fixed the add_sat() builtin function crash issueShow Liu
2015-06-04Implement CL_DEVICE_PARTITION_TYPE case of clGetDeviceInfo()Gil Pitney
Used by clients to determine how a (sub)device was partitioned by clCreateSubDevices() Signed-off-by: Gil Pitney <gil.pitney@linaro.org>