Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

-Removed some uneeded header guards

-Activate dead code elimination
  • Loading branch information...
commit f980f2f40b8d19bd84f50ab110ebf9052c7beee1 1 parent 3045878
@apriori authored
View
327 cl/cl.nim
@@ -24,6 +24,7 @@
import "cl/cl_platform"
{.push callConv: stdcall.}
+{.deadCodeElim:on.}
when defined(windows):
@@ -50,8 +51,8 @@ type
TCLBool*{.pure, final.} = PCLObject
# WARNING! Unlike TCL types in TCLplatform.h, TCLbool is not guaranteed to be the same size as the bool in kernels.
type
- TCLSize_t* = TCLUlong
- TCLBitfield* = TCLUlong
+ TCLsize_t* = TCLulong
+ TCLBitfield* = TCLulong
TCLDevice_type* = TCLbitfield
TCLPlatform_info* = TCLuint
TCLDevice_info* = TCLuint
@@ -87,8 +88,8 @@ type
# image_channel_data_type*: TCLchannel_type
#TCLBuffer_region*{.pure, final.} = object
- # origin*: TCLSize_t
- # size*: TCLSize_t
+ # origin*: TCLsize_t
+ # size*: TCLsize_t
#****************************************************************************
# Error Codes
@@ -289,7 +290,7 @@ const
CL_RGBA* = 0x000010B5
CL_BGRA* = 0x000010B6
CL_ARGB* = 0x000010B7
- TCLIntENSITY* = 0x000010B8
+ TCLintENSITY* = 0x000010B8
CL_LUMINANCE* = 0x000010B9
CL_Rx* = 0x000010BA
CL_RGx* = 0x000010BB
@@ -441,68 +442,68 @@ const
# Platform API
proc clGetPlatformIDs*(a2: TCLUint, # num_entries
a3: ptr TCLPlatform_id, # platforms
- a4: ptr TCLUint): TCLInt {.importc: "clGetPlatformIDs", dynlib: cldll.}
+ a4: ptr TCLUint): TCLint {.importc: "clGetPlatformIDs", dynlib: cldll.}
# num_platforms
proc clGetPlatformInfo*(a2: TCLPlatform_id, # platform
a3: TCLPlatform_info, # param_name
- a4: TCLSize_t, # param_value_size
+ a4: TCLsize_t, # param_value_size
a5: pointer,
- a6: ptr TCLSize_t): TCLInt {.importc: "clGetPlatformInfo", dynlib: cldll.}
+ a6: ptr TCLsize_t): TCLint {.importc: "clGetPlatformInfo", dynlib: cldll.}
# param_value_size_ret
# Device APIs
proc clGetDeviceIDs*(a2: TCLPlatform_id, # platform
a3: TCLDevice_type, # device_type
a4: TCLUint, # num_entries
a5: ptr TCLDevice_id, # devices
- a6: ptr TCLUint): TCLInt {.importc: "clGetDeviceIDs", dynlib: cldll.}
+ a6: ptr TCLUint): TCLint {.importc: "clGetDeviceIDs", dynlib: cldll.}
# num_devices
proc clGetDeviceInfo*(a2: TCLDevice_id, # device
a3: TCLDevice_info, # param_name
- a4: TCLSize_t, # param_value_size
+ a4: TCLsize_t, # param_value_size
a5: pointer,
- a6: ptr TCLSize_t): TCLInt {.importc: "clGetDeviceInfo", dynlib: cldll.}
+ a6: ptr TCLsize_t): TCLint {.importc: "clGetDeviceInfo", dynlib: cldll.}
# param_value_size_ret
# Context APIs
proc clCreateContext*(a2: ptr TCLContext_properties, # properties
a3: TCLUint, # num_devices
a4: ptr TCLDevice_id, # devices
- a5: proc (a2: cstring, a3: pointer, a4: TCLSize_t,
+ a5: proc (a2: cstring, a3: pointer, a4: TCLsize_t,
a5: pointer),
a6: pointer,
- a7: ptr TCLInt): TCLContext {.importc: "clCreateContext", dynlib: cldll.}
+ a7: ptr TCLint): TCLContext {.importc: "clCreateContext", dynlib: cldll.}
# errcode_ret
proc clCreateContextFromType*(a2: ptr TCLContext_properties, # properties
a3: TCLDevice_type, # device_type
- a4: proc (a2: cstring, a3: pointer, a4: TCLSize_t,
+ a4: proc (a2: cstring, a3: pointer, a4: TCLsize_t,
a5: pointer), # pfn_notify
a5: pointer,
- a6: ptr TCLInt): TCLContext {.importc: "clCreateContextFromType", dynlib: cldll.}
+ a6: ptr TCLint): TCLContext {.importc: "clCreateContextFromType", dynlib: cldll.}
# errcode_ret
-proc clRetainContext*(a2: TCLContext): TCLInt {.importc: "clRetainContext", dynlib: cldll.}
+proc clRetainContext*(a2: TCLContext): TCLint {.importc: "clRetainContext", dynlib: cldll.}
# context
-proc clReleaseContext*(a2: TCLContext): TCLInt {.importc: "clReleaseContext", dynlib: cldll.}
+proc clReleaseContext*(a2: TCLContext): TCLint {.importc: "clReleaseContext", dynlib: cldll.}
# context
proc clGetContextInfo*(a2: TCLContext, # context
a3: TCLContext_info, # param_name
- a4: TCLSize_t, # param_value_size
+ a4: TCLsize_t, # param_value_size
a5: pointer,
- a6: ptr TCLSize_t): TCLInt {.importc: "clGetContextInfo", dynlib: cldll.}
+ a6: ptr TCLsize_t): TCLint {.importc: "clGetContextInfo", dynlib: cldll.}
# param_value_size_ret
# Command Queue APIs
proc clCreateCommandQueue*(a2: TCLContext, # context
a3: TCLDevice_id, # device
a4: TCLCommand_queue_properties, # properties
- a5: ptr TCLInt): TCLCommand_queue {.importc: "clCreateCommandQueue", dynlib: cldll.}
+ a5: ptr TCLint): TCLCommand_queue {.importc: "clCreateCommandQueue", dynlib: cldll.}
# errcode_ret
-proc clRetainCommandQueue*(a2: TCLCommand_queue): TCLInt {.importc: "clRetainCommandQueue", dynlib: cldll.}
+proc clRetainCommandQueue*(a2: TCLCommand_queue): TCLint {.importc: "clRetainCommandQueue", dynlib: cldll.}
# command_queue
-proc clReleaseCommandQueue*(a2: TCLCommand_queue): TCLInt {.importc: "clReleaseCommandQueue", dynlib: cldll.}
+proc clReleaseCommandQueue*(a2: TCLCommand_queue): TCLint {.importc: "clReleaseCommandQueue", dynlib: cldll.}
# command_queue
proc clGetCommandQueueInfo*(a2: TCLCommand_queue, # command_queue
a3: TCLCommand_queue_info, # param_name
- a4: TCLSize_t, # param_value_size
+ a4: TCLsize_t, # param_value_size
a5: pointer,
- a6: ptr TCLSize_t): TCLInt {.importc: "clGetCommandQueueInfo", dynlib: cldll.}
+ a6: ptr TCLsize_t): TCLint {.importc: "clGetCommandQueueInfo", dynlib: cldll.}
# param_value_size_ret
when defined(CL_USE_OPENCL_1_0_APIS):
#
@@ -518,96 +519,96 @@ when defined(CL_USE_OPENCL_1_0_APIS):
proc clSetCommandQueueProperty*(a2: TCLCommand_queue, # command_queue
a3: TCLCommand_queue_properties, # properties
a4: cl_bool, # enable
- a5: ptr TCLCommand_queue_properties): TCLInt {.importc: "clSetCommandQueueProperty", dynlib: cldll.}
+ a5: ptr TCLCommand_queue_properties): TCLint {.importc: "clSetCommandQueueProperty", dynlib: cldll.}
# old_properties
# Memory Object APIs
proc clCreateBuffer*(a2: TCLContext, # context
a3: TCLMem_flags, # flags
- a4: TCLSize_t, # size
+ a4: TCLsize_t, # size
a5: pointer, a6:
- ptr TCLInt): TCLMem {.importc: "clCreateBuffer", dynlib: cldll.}
+ ptr TCLint): TCLMem {.importc: "clCreateBuffer", dynlib: cldll.}
# errcode_ret
proc clCreateSubBuffer*(a2: TCLMem, # buffer
a3: TCLMem_flags, # flags
a4: TCLBuffer_create_type, # buffer_create_type
- a5: pointer, a6: ptr TCLInt): TCLMem {.importc: "clCreateSubBuffer", dynlib: cldll.}
+ a5: pointer, a6: ptr TCLint): TCLMem {.importc: "clCreateSubBuffer", dynlib: cldll.}
# errcode_ret
proc clCreateImage2D*(a2: TCLContext, # context
a3: TCLMem_flags, # flags
a4: ptr TCLImage_format, # image_format
- a5: TCLSize_t, # image_width
- a6: TCLSize_t, # image_height
- a7: TCLSize_t, # image_row_pitch
- a8: pointer, a9: ptr TCLInt): TCLMem {.importc: "clCreateImage2D", dynlib: cldll.}
+ a5: TCLsize_t, # image_width
+ a6: TCLsize_t, # image_height
+ a7: TCLsize_t, # image_row_pitch
+ a8: pointer, a9: ptr TCLint): TCLMem {.importc: "clCreateImage2D", dynlib: cldll.}
# errcode_ret
proc clCreateImage3D*(a2: TCLContext, # context
a3: TCLMem_flags, # flags
a4: ptr TCLImage_format, # image_format
- a5: TCLSize_t, # image_width
- a6: TCLSize_t, # image_height
- a7: TCLSize_t, # image_depth
- a8: TCLSize_t, # image_row_pitch
- a9: TCLSize_t, # image_slice_pitch
- a10: pointer, a11: ptr TCLInt): TCLMem {.importc: "clCreateImage3D", dynlib: cldll.}
+ a5: TCLsize_t, # image_width
+ a6: TCLsize_t, # image_height
+ a7: TCLsize_t, # image_depth
+ a8: TCLsize_t, # image_row_pitch
+ a9: TCLsize_t, # image_slice_pitch
+ a10: pointer, a11: ptr TCLint): TCLMem {.importc: "clCreateImage3D", dynlib: cldll.}
# errcode_ret
-proc clRetainMemObject*(a2: TCLMem): TCLInt {.importc: "clRetainMemObject", dynlib: cldll.}
+proc clRetainMemObject*(a2: TCLMem): TCLint {.importc: "clRetainMemObject", dynlib: cldll.}
# memobj
-proc clReleaseMemObject*(a2: TCLMem): TCLInt {.importc: "clReleaseMemObject", dynlib: cldll.}
+proc clReleaseMemObject*(a2: TCLMem): TCLint {.importc: "clReleaseMemObject", dynlib: cldll.}
# memobj
proc clGetSupportedImageFormats*(a2: TCLContext, # context
a3: TCLMem_flags, # flags
a4: TCLMem_object_type, # image_type
a5: TCLUint, # num_entries
a6: ptr TCLImage_format, # image_formats
- a7: ptr TCLUint): TCLInt {.importc: "clGetSupportedImageFormats", dynlib: cldll.}
+ a7: ptr TCLUint): TCLint {.importc: "clGetSupportedImageFormats", dynlib: cldll.}
# num_image_formats
proc clGetMemObjectInfo*(a2: TCLMem, # memobj
a3: TCLMem_info, # param_name
- a4: TCLSize_t, # param_value_size
- a5: pointer, a6: ptr TCLSize_t): TCLInt {.importc: "clGetMemObjectInfo", dynlib: cldll.}
+ a4: TCLsize_t, # param_value_size
+ a5: pointer, a6: ptr TCLsize_t): TCLint {.importc: "clGetMemObjectInfo", dynlib: cldll.}
# param_value_size_ret
proc clGetImageInfo*(a2: TCLMem, # image
a3: TCLImage_info, # param_name
- a4: TCLSize_t, # param_value_size
- a5: pointer, a6: ptr TCLSize_t): TCLInt {.importc: "clGetImageInfo", dynlib: cldll.}
+ a4: TCLsize_t, # param_value_size
+ a5: pointer, a6: ptr TCLsize_t): TCLint {.importc: "clGetImageInfo", dynlib: cldll.}
# param_value_size_ret
proc clSetMemObjectDestructorCallback*(a2: TCLMem, # memobj
a3: proc (a2: TCLMem, # memobj
a3: pointer), #pfn_notify
- a4: pointer): TCLInt {.importc: "clSetMemObjectDestructorCallback", dynlib: cldll.}
+ a4: pointer): TCLint {.importc: "clSetMemObjectDestructorCallback", dynlib: cldll.}
# Sampler APIs
proc clCreateSampler*(a2: TCLContext, # context
a3: TCLBool, # normalized_coords
a4: TCLAddressing_mode, # addressing_mode
a5: TCLFilter_mode, # filter_mode
- a6: ptr TCLInt): TCLSampler {.importc: "clCreateSampler", dynlib: cldll.}
+ a6: ptr TCLint): TCLSampler {.importc: "clCreateSampler", dynlib: cldll.}
# errcode_ret
-proc clRetainSampler*(a2: TCLSampler): TCLInt {.importc: "clRetainSampler", dynlib: cldll.}
+proc clRetainSampler*(a2: TCLSampler): TCLint {.importc: "clRetainSampler", dynlib: cldll.}
# sampler
-proc clReleaseSampler*(a2: TCLSampler): TCLInt {.importc: "clReleaseSampler", dynlib: cldll.}
+proc clReleaseSampler*(a2: TCLSampler): TCLint {.importc: "clReleaseSampler", dynlib: cldll.}
# sampler
proc clGetSamplerInfo*(a2: TCLSampler, # sampler
a3: TCLSampler_info, # param_name
- a4: TCLSize_t, # param_value_size
- a5: pointer, a6: ptr TCLSize_t): TCLInt {.importc: "clGetSamplerInfo", dynlib: cldll.}
+ a4: TCLsize_t, # param_value_size
+ a5: pointer, a6: ptr TCLsize_t): TCLint {.importc: "clGetSamplerInfo", dynlib: cldll.}
# param_value_size_ret
# Program Object APIs
proc clCreateProgramWithSource*(a2: TCLContext, # context
a3: TCLUint, # count
- a4: cstringArray, a5: ptr TCLSize_t, # lengths
- a6: ptr TCLInt): TCLProgram {.importc: "clCreateProgramWithSource", dynlib: cldll.}
+ a4: cstringArray, a5: ptr TCLsize_t, # lengths
+ a6: ptr TCLint): TCLProgram {.importc: "clCreateProgramWithSource", dynlib: cldll.}
# errcode_ret
proc clCreateProgramWithBinary*(a2: TCLContext, # context
a3: TCLUint, # num_devices
a4: ptr TCLDevice_id, # device_list
- a5: ptr TCLSize_t, # lengths
+ a5: ptr TCLsize_t, # lengths
a6: ptr ptr cchar, # binaries
- a7: ptr TCLInt, # binary_status
- a8: ptr TCLInt): TCLProgram {.importc: "clCreateProgramWithBinary", dynlib: cldll.}
+ a7: ptr TCLint, # binary_status
+ a8: ptr TCLint): TCLProgram {.importc: "clCreateProgramWithBinary", dynlib: cldll.}
# errcode_ret
-proc clRetainProgram*(a2: TCLProgram): TCLInt {.importc: "clRetainProgram", dynlib: cldll.}
+proc clRetainProgram*(a2: TCLProgram): TCLint {.importc: "clRetainProgram", dynlib: cldll.}
# program
-proc clReleaseProgram*(a2: TCLProgram): TCLInt {.importc: "clReleaseProgram", dynlib: cldll.}
+proc clReleaseProgram*(a2: TCLProgram): TCLint {.importc: "clReleaseProgram", dynlib: cldll.}
# program
proc clBuildProgram*(a2: TCLProgram, # program
a3: TCLUint, # num_devices
@@ -615,258 +616,258 @@ proc clBuildProgram*(a2: TCLProgram, # program
a5: cstring,
a6: proc (a2: TCLProgram, # program
a3: pointer), # pfn_notify
- a7: pointer): TCLInt {.importc: "clBuildProgram", dynlib: cldll.}
-proc clUnloadCompiler*(): TCLInt {.importc: "clUnloadCompiler", dynlib: cldll.}
+ a7: pointer): TCLint {.importc: "clBuildProgram", dynlib: cldll.}
+proc clUnloadCompiler*(): TCLint {.importc: "clUnloadCompiler", dynlib: cldll.}
proc clGetProgramInfo*(a2: TCLProgram, # program
a3: TCLProgram_info, # param_name
- a4: TCLSize_t, # param_value_size
- a5: pointer, a6: ptr TCLSize_t): TCLInt {.importc: "clGetProgramInfo", dynlib: cldll.}
+ a4: TCLsize_t, # param_value_size
+ a5: pointer, a6: ptr TCLsize_t): TCLint {.importc: "clGetProgramInfo", dynlib: cldll.}
# param_value_size_ret
proc clGetProgramBuildInfo*(a2: TCLProgram, # program
a3: TCLDevice_id, # device
a4: TCLProgram_build_info, # param_name
- a5: TCLSize_t, # param_value_size
- a6: pointer, a7: ptr TCLSize_t): TCLInt {.importc: "clGetProgramBuildInfo", dynlib: cldll.}
+ a5: TCLsize_t, # param_value_size
+ a6: pointer, a7: ptr TCLsize_t): TCLint {.importc: "clGetProgramBuildInfo", dynlib: cldll.}
# param_value_size_ret
# Kernel Object APIs
proc clCreateKernel*(a2: TCLProgram, # program
- a3: cstring, a4: ptr TCLInt): TCLKernel {.importc: "clCreateKernel", dynlib: cldll.}
+ a3: cstring, a4: ptr TCLint): TCLKernel {.importc: "clCreateKernel", dynlib: cldll.}
# errcode_ret
proc clCreateKernelsInProgram*(a2: TCLProgram, # program
a3: TCLUint, # num_kernels
a4: ptr TCLKernel, # kernels
- a5: ptr TCLUint): TCLInt {.importc: "clCreateKernelsInProgram", dynlib: cldll.}
+ a5: ptr TCLUint): TCLint {.importc: "clCreateKernelsInProgram", dynlib: cldll.}
# num_kernels_ret
-proc clRetainKernel*(a2: TCLKernel): TCLInt {.importc: "clRetainKernel", dynlib: cldll.}
+proc clRetainKernel*(a2: TCLKernel): TCLint {.importc: "clRetainKernel", dynlib: cldll.}
# kernel
-proc clReleaseKernel*(a2: TCLKernel): TCLInt {.importc: "clReleaseKernel", dynlib: cldll.}
+proc clReleaseKernel*(a2: TCLKernel): TCLint {.importc: "clReleaseKernel", dynlib: cldll.}
# kernel
proc clSetKernelArg*(a2: TCLKernel, # kernel
a3: TCLUint, # arg_index
- a4: TCLSize_t, # arg_size
- a5: pointer): TCLInt {.importc: "clSetKernelArg", dynlib: cldll.}
+ a4: TCLsize_t, # arg_size
+ a5: pointer): TCLint {.importc: "clSetKernelArg", dynlib: cldll.}
proc clGetKernelInfo*(a2: TCLKernel, # kernel
a3: TCLKernel_info, # param_name
- a4: TCLSize_t, # param_value_size
- a5: pointer, a6: ptr TCLSize_t): TCLInt {.importc: "clGetKernelInfo", dynlib: cldll.}
+ a4: TCLsize_t, # param_value_size
+ a5: pointer, a6: ptr TCLsize_t): TCLint {.importc: "clGetKernelInfo", dynlib: cldll.}
# param_value_size_ret
proc clGetKernelWorkGroupInfo*(a2: TCLKernel, # kernel
a3: TCLDevice_id, # device
a4: TCLKernel_work_group_info, # param_name
- a5: TCLSize_t, # param_value_size
- a6: pointer, a7: ptr TCLSize_t): TCLInt {.importc: "clGetKernelWorkGroupInfo", dynlib: cldll.}
+ a5: TCLsize_t, # param_value_size
+ a6: pointer, a7: ptr TCLsize_t): TCLint {.importc: "clGetKernelWorkGroupInfo", dynlib: cldll.}
# param_value_size_ret
# Event Object APIs
proc clWaitForEvents*(a2: TCLUint, # num_events
- a3: ptr TCLKernel): TCLInt {.importc: "clWaitForEvents", dynlib: cldll.}
+ a3: ptr TCLKernel): TCLint {.importc: "clWaitForEvents", dynlib: cldll.}
# event_list
proc clGetEventInfo*(a2: TCLEvent, # event
a3: TCLEvent_info, # param_name
- a4: TCLSize_t, # param_value_size
- a5: pointer, a6: ptr TCLSize_t): TCLInt {.importc: "clGetEventInfo", dynlib: cldll.}
+ a4: TCLsize_t, # param_value_size
+ a5: pointer, a6: ptr TCLsize_t): TCLint {.importc: "clGetEventInfo", dynlib: cldll.}
# param_value_size_ret
proc clCreateUserEvent*(a2: TCLContext, # context
- a3: ptr TCLInt): TCLEvent {.importc: "clCreateUserEvent", dynlib: cldll.}
+ a3: ptr TCLint): TCLEvent {.importc: "clCreateUserEvent", dynlib: cldll.}
# errcode_ret
-proc clRetainEvent*(a2: TCLEvent): TCLInt {.importc: "clRetainEvent", dynlib: cldll.}
+proc clRetainEvent*(a2: TCLEvent): TCLint {.importc: "clRetainEvent", dynlib: cldll.}
# event
-proc clReleaseEvent*(a2: TCLEvent): TCLInt {.importc: "clReleaseEvent", dynlib: cldll.}
+proc clReleaseEvent*(a2: TCLEvent): TCLint {.importc: "clReleaseEvent", dynlib: cldll.}
# event
proc clSetUserEventStatus*(a2: TCLEvent, # event
- a3: TCLInt): TCLInt {.importc: "clSetUserEventStatus", dynlib: cldll.}
+ a3: TCLint): TCLint {.importc: "clSetUserEventStatus", dynlib: cldll.}
# execution_status
proc clSetEventCallback*(a2: TCLEvent, # event
- a3: TCLInt, # command_exec_callback_type
- a4: proc (a2: TCLEvent, a3: TCLInt, a4: pointer), # pfn_notify
- a5: pointer): TCLInt {.importc: "clSetEventCallback", dynlib: cldll.}
+ a3: TCLint, # command_exec_callback_type
+ a4: proc (a2: TCLEvent, a3: TCLint, a4: pointer), # pfn_notify
+ a5: pointer): TCLint {.importc: "clSetEventCallback", dynlib: cldll.}
# Profiling APIs
proc clGetEventProfilingInfo*(a2: TCLEvent, # event
a3: TCLProfiling_info, # param_name
- a4: TCLSize_t, # param_value_size
- a5: pointer, a6: ptr TCLSize_t): TCLInt {.importc: "clGetEventProfilingInfo", dynlib: cldll.}
+ a4: TCLsize_t, # param_value_size
+ a5: pointer, a6: ptr TCLsize_t): TCLint {.importc: "clGetEventProfilingInfo", dynlib: cldll.}
# param_value_size_ret
# Flush and Finish APIs
-proc clFlush*(a2: TCLCommand_queue): TCLInt {.importc: "clFlush", dynlib: cldll.}
+proc clFlush*(a2: TCLCommand_queue): TCLint {.importc: "clFlush", dynlib: cldll.}
# command_queue
-proc clFinish*(a2: TCLCommand_queue): TCLInt {.importc: "clFinish", dynlib: cldll.}
+proc clFinish*(a2: TCLCommand_queue): TCLint {.importc: "clFinish", dynlib: cldll.}
# command_queue
# Enqueued Commands APIs
proc clEnqueueReadBuffer*(a2: TCLCommand_queue, # command_queue
a3: TCLMem, # buffer
a4: TCLBool, # blocking_read
- a5: TCLSize_t, # offset
- a6: TCLSize_t, # cb
+ a5: TCLsize_t, # offset
+ a6: TCLsize_t, # cb
a7: pointer, a8: TCLUint, # num_events_in_wait_list
a9: ptr TCLEvent, # event_wait_list
- a10: ptr TCLEvent): TCLInt {.importc: "clEnqueueReadBuffer", dynlib: cldll.}
+ a10: ptr TCLEvent): TCLint {.importc: "clEnqueueReadBuffer", dynlib: cldll.}
# event
proc clEnqueueReadBufferRect*(a2: TCLCommand_queue, # command_queue
a3: TCLMem, # buffer
a4: TCLBool, # blocking_read
- a5: ptr TCLSize_t, # buffer_origin
- a6: ptr TCLSize_t, # host_origin
- a7: ptr TCLSize_t, # region
- a8: TCLSize_t, # buffer_row_pitch
- a9: TCLSize_t, # buffer_slice_pitch
- a10: TCLSize_t, # host_row_pitch
- a11: TCLSize_t, # host_slice_pitch
+ a5: ptr TCLsize_t, # buffer_origin
+ a6: ptr TCLsize_t, # host_origin
+ a7: ptr TCLsize_t, # region
+ a8: TCLsize_t, # buffer_row_pitch
+ a9: TCLsize_t, # buffer_slice_pitch
+ a10: TCLsize_t, # host_row_pitch
+ a11: TCLsize_t, # host_slice_pitch
a12: pointer, a13: TCLUint, #
# num_events_in_wait_list
a14: ptr TCLEvent, # event_wait_list
- a15: ptr TCLEvent): TCLInt {.importc: "clEnqueueReadBufferRect", dynlib: cldll.}
+ a15: ptr TCLEvent): TCLint {.importc: "clEnqueueReadBufferRect", dynlib: cldll.}
# event
proc clEnqueueWriteBuffer*(a2: TCLCommand_queue, # command_queue
a3: TCLMem, # buffer
a4: TCLBool, # blocking_write
- a5: TCLSize_t, # offset
- a6: TCLSize_t, # cb
+ a5: TCLsize_t, # offset
+ a6: TCLsize_t, # cb
a7: pointer, a8: TCLUint, # num_events_in_wait_list
a9: ptr TCLEvent, # event_wait_list
- a10: ptr TCLEvent): TCLInt {.importc: "clEnqueueWriteBuffer", dynlib: cldll.}
+ a10: ptr TCLEvent): TCLint {.importc: "clEnqueueWriteBuffer", dynlib: cldll.}
# event
proc clEnqueueWriteBufferRect*(a2: TCLCommand_queue, # command_queue
a3: TCLMem, # buffer
a4: TCLBool, # blocking_write
- a5: ptr TCLSize_t, # buffer_origin
- a6: ptr TCLSize_t, # host_origin
- a7: ptr TCLSize_t, # region
- a8: TCLSize_t, # buffer_row_pitch
- a9: TCLSize_t, # buffer_slice_pitch
- a10: TCLSize_t, # host_row_pitch
- a11: TCLSize_t, # host_slice_pitch
+ a5: ptr TCLsize_t, # buffer_origin
+ a6: ptr TCLsize_t, # host_origin
+ a7: ptr TCLsize_t, # region
+ a8: TCLsize_t, # buffer_row_pitch
+ a9: TCLsize_t, # buffer_slice_pitch
+ a10: TCLsize_t, # host_row_pitch
+ a11: TCLsize_t, # host_slice_pitch
a12: pointer, a13: TCLUint, #
# num_events_in_wait_list
a14: ptr TCLEvent, # event_wait_list
- a15: ptr TCLEvent): TCLInt {.importc: "clEnqueueWriteBufferRect", dynlib: cldll.}
+ a15: ptr TCLEvent): TCLint {.importc: "clEnqueueWriteBufferRect", dynlib: cldll.}
# event
proc clEnqueueCopyBuffer*(a2: TCLCommand_queue, # command_queue
a3: TCLMem, # src_buffer
a4: TCLMem, # dst_buffer
- a5: TCLSize_t, # src_offset
- a6: TCLSize_t, # dst_offset
- a7: TCLSize_t, # cb
+ a5: TCLsize_t, # src_offset
+ a6: TCLsize_t, # dst_offset
+ a7: TCLsize_t, # cb
a8: TCLUint, # num_events_in_wait_list
a9: ptr TCLEvent, # event_wait_list
- a10: ptr TCLEvent): TCLInt {.importc: "clEnqueueCopyBuffer", dynlib: cldll.}
+ a10: ptr TCLEvent): TCLint {.importc: "clEnqueueCopyBuffer", dynlib: cldll.}
# event
proc clEnqueueCopyBufferRect*(a2: TCLCommand_queue, # command_queue
a3: TCLMem, # src_buffer
a4: TCLMem, # dst_buffer
- a5: ptr TCLSize_t, # src_origin
- a6: ptr TCLSize_t, # dst_origin
- a7: ptr TCLSize_t, # region
- a8: TCLSize_t, # src_row_pitch
- a9: TCLSize_t, # src_slice_pitch
- a10: TCLSize_t, # dst_row_pitch
- a11: TCLSize_t, # dst_slice_pitch
+ a5: ptr TCLsize_t, # src_origin
+ a6: ptr TCLsize_t, # dst_origin
+ a7: ptr TCLsize_t, # region
+ a8: TCLsize_t, # src_row_pitch
+ a9: TCLsize_t, # src_slice_pitch
+ a10: TCLsize_t, # dst_row_pitch
+ a11: TCLsize_t, # dst_slice_pitch
a12: TCLUint, # num_events_in_wait_list
a13: ptr TCLEvent, # event_wait_list
- a14: ptr TCLEvent): TCLInt {.importc: "clEnqueueCopyBufferRect", dynlib: cldll.}
+ a14: ptr TCLEvent): TCLint {.importc: "clEnqueueCopyBufferRect", dynlib: cldll.}
# event
proc clEnqueueReadImage*(a2: TCLCommand_queue, # command_queue
a3: TCLMem, # image
a4: TCLBool, # blocking_read
- a5: ptr TCLSize_t, # origin[3]
- a6: ptr TCLSize_t, # region[3]
- a7: TCLSize_t, # row_pitch
- a8: TCLSize_t, # slice_pitch
+ a5: ptr TCLsize_t, # origin[3]
+ a6: ptr TCLsize_t, # region[3]
+ a7: TCLsize_t, # row_pitch
+ a8: TCLsize_t, # slice_pitch
a9: pointer, a10: TCLUint, # num_events_in_wait_list
a11: ptr TCLEvent, # event_wait_list
- a12: ptr TCLEvent): TCLInt {.importc: "clEnqueueReadImage", dynlib: cldll.}
+ a12: ptr TCLEvent): TCLint {.importc: "clEnqueueReadImage", dynlib: cldll.}
# event
proc clEnqueueWriteImage*(a2: TCLCommand_queue, # command_queue
a3: TCLMem, # image
a4: TCLBool, # blocking_write
- a5: ptr TCLSize_t, # origin[3]
- a6: ptr TCLSize_t, # region[3]
- a7: TCLSize_t, # input_row_pitch
- a8: TCLSize_t, # input_slice_pitch
+ a5: ptr TCLsize_t, # origin[3]
+ a6: ptr TCLsize_t, # region[3]
+ a7: TCLsize_t, # input_row_pitch
+ a8: TCLsize_t, # input_slice_pitch
a9: pointer, a10: TCLUint, # num_events_in_wait_list
a11: ptr TCLEvent, # event_wait_list
- a12: ptr TCLEvent): TCLInt {.importc: "clEnqueueWriteImage", dynlib: cldll.}
+ a12: ptr TCLEvent): TCLint {.importc: "clEnqueueWriteImage", dynlib: cldll.}
# event
proc clEnqueueCopyImage*(a2: TCLCommand_queue, # command_queue
a3: TCLMem, # src_image
a4: TCLMem, # dst_image
- a5: ptr TCLSize_t, # src_origin[3]
- a6: ptr TCLSize_t, # dst_origin[3]
- a7: ptr TCLSize_t, # region[3]
+ a5: ptr TCLsize_t, # src_origin[3]
+ a6: ptr TCLsize_t, # dst_origin[3]
+ a7: ptr TCLsize_t, # region[3]
a8: TCLUint, # num_events_in_wait_list
a9: ptr TCLEvent, # event_wait_list
- a10: ptr TCLEvent): TCLInt {.importc: "clEnqueueCopyImage", dynlib: cldll.}
+ a10: ptr TCLEvent): TCLint {.importc: "clEnqueueCopyImage", dynlib: cldll.}
# event
proc clEnqueueCopyImageToBuffer*(a2: TCLCommand_queue, # command_queue
a3: TCLMem, # src_image
a4: TCLMem, # dst_buffer
- a5: ptr TCLSize_t, # src_origin[3]
- a6: ptr TCLSize_t, # region[3]
- a7: TCLSize_t, # dst_offset
+ a5: ptr TCLsize_t, # src_origin[3]
+ a6: ptr TCLsize_t, # region[3]
+ a7: TCLsize_t, # dst_offset
a8: TCLUint, # num_events_in_wait_list
a9: ptr TCLEvent, # event_wait_list
- a10: ptr TCLEvent): TCLInt {.importc: "clEnqueueCopyImageToBuffer", dynlib: cldll.}
+ a10: ptr TCLEvent): TCLint {.importc: "clEnqueueCopyImageToBuffer", dynlib: cldll.}
# event
proc clEnqueueCopyBufferToImage*(a2: TCLCommand_queue, # command_queue
a3: TCLMem, # src_buffer
a4: TCLMem, # dst_image
- a5: TCLSize_t, # src_offset
- a6: ptr TCLSize_t, # dst_origin[3]
- a7: ptr TCLSize_t, # region[3]
+ a5: TCLsize_t, # src_offset
+ a6: ptr TCLsize_t, # dst_origin[3]
+ a7: ptr TCLsize_t, # region[3]
a8: TCLUint, # num_events_in_wait_list
a9: ptr TCLEvent, # event_wait_list
- a10: ptr TCLEvent): TCLInt {.importc: "clEnqueueCopyBufferToImage", dynlib: cldll.}
+ a10: ptr TCLEvent): TCLint {.importc: "clEnqueueCopyBufferToImage", dynlib: cldll.}
# event
proc clEnqueueMapBuffer*(a2: TCLCommand_queue, # command_queue
a3: TCLMem, # buffer
a4: TCLBool, # blocking_map
a5: TCLMap_flags, # map_flags
- a6: TCLSize_t, # offset
- a7: TCLSize_t, # cb
+ a6: TCLsize_t, # offset
+ a7: TCLsize_t, # cb
a8: TCLUint, # num_events_in_wait_list
a9: ptr TCLEvent, # event_wait_list
a10: ptr TCLEvent, # event
- a11: ptr TCLInt): pointer {.importc: "clEnqueueMapBuffer", dynlib: cldll.}
+ a11: ptr TCLint): pointer {.importc: "clEnqueueMapBuffer", dynlib: cldll.}
# errcode_ret
proc clEnqueueMapImage*(a2: TCLCommand_queue, # command_queue
a3: TCLMem, # image
a4: TCLBool, # blocking_map
a5: TCLMap_flags, # map_flags
- a6: ptr TCLSize_t, # origin[3]
- a7: ptr TCLSize_t, # region[3]
- a8: ptr TCLSize_t, # image_row_pitch
- a9: ptr TCLSize_t, # image_slice_pitch
+ a6: ptr TCLsize_t, # origin[3]
+ a7: ptr TCLsize_t, # region[3]
+ a8: ptr TCLsize_t, # image_row_pitch
+ a9: ptr TCLsize_t, # image_slice_pitch
a10: TCLUint, # num_events_in_wait_list
a11: ptr TCLEvent, # event_wait_list
a12: ptr TCLEvent, # event
- a13: ptr TCLInt): pointer {.importc: "clEnqueueMapImage", dynlib: cldll.}
+ a13: ptr TCLint): pointer {.importc: "clEnqueueMapImage", dynlib: cldll.}
# errcode_ret
proc clEnqueueUnmapMemObject*(a2: TCLCommand_queue, # command_queue
a3: TCLMem, # memobj
a4: pointer, a5: TCLUint, #
# num_events_in_wait_list
a6: ptr TCLEvent, # event_wait_list
- a7: ptr TCLEvent): TCLInt {.importc: "clEnqueueUnmapMemObject", dynlib: cldll.}
+ a7: ptr TCLEvent): TCLint {.importc: "clEnqueueUnmapMemObject", dynlib: cldll.}
# event
proc clEnqueueNDRangeKernel*(a2: TCLCommand_queue, # command_queue
a3: TCLKernel, # kernel
a4: TCLUint, # work_dim
- a5: ptr TCLSize_t, # global_work_offset
- a6: ptr TCLSize_t, # global_work_size
- a7: ptr TCLSize_t, # local_work_size
+ a5: ptr TCLsize_t, # global_work_offset
+ a6: ptr TCLsize_t, # global_work_size
+ a7: ptr TCLsize_t, # local_work_size
a8: TCLUint, # num_events_in_wait_list
a9: ptr TCLEvent, # event_wait_list
- a10: ptr TCLEvent): TCLInt {.importc: "clEnqueueNDRangeKernel", dynlib: cldll.}
+ a10: ptr TCLEvent): TCLint {.importc: "clEnqueueNDRangeKernel", dynlib: cldll.}
# event
proc clEnqueueTask*(a2: TCLCommand_queue, # command_queue
a3: TCLKernel, # kernel
a4: TCLUint, # num_events_in_wait_list
a5: ptr TCLEvent, # event_wait_list
- a6: ptr TCLEvent): TCLInt {.importc: "clEnqueueTask", dynlib: cldll.}
+ a6: ptr TCLEvent): TCLint {.importc: "clEnqueueTask", dynlib: cldll.}
# event
-#extern TCLInt
+#extern TCLint
#clEnqueueNativeKernel(TCLCommand_queue /* command_queue */,
# void (*user_func)(void *),
# void * /* args */,
-# TCLSize_t /* cb_args */,
+# TCLsize_t /* cb_args */,
# TCLUint /* num_mem_objects */,
# const cl_mem * /* mem_list */,
# const void ** /* args_mem_loc */,
@@ -874,13 +875,13 @@ proc clEnqueueTask*(a2: TCLCommand_queue, # command_queue
# const cl_event * /* event_wait_list */,
# cl_event * /* event */) ;
proc clEnqueueMarker*(a2: TCLCommand_queue, # command_queue
- a3: ptr TCLEvent): TCLInt {.importc: "clEnqueueMarker", dynlib: cldll.}
+ a3: ptr TCLEvent): TCLint {.importc: "clEnqueueMarker", dynlib: cldll.}
# event
proc clEnqueueWaitForEvents*(a2: TCLCommand_queue, # command_queue
a3: TCLUint, # num_events
- a4: ptr TCLEvent): TCLInt {.importc: "clEnqueueWaitForEvents", dynlib: cldll.}
+ a4: ptr TCLEvent): TCLint {.importc: "clEnqueueWaitForEvents", dynlib: cldll.}
# event_list
-proc clEnqueueBarrier*(a2: TCLCommand_queue): TCLInt {.importc: "clEnqueueBarrier", dynlib: cldll.}
+proc clEnqueueBarrier*(a2: TCLCommand_queue): TCLint {.importc: "clEnqueueBarrier", dynlib: cldll.}
# command_queue
# Extension function access
#
View
292 cl/cl_ext.nim
@@ -22,155 +22,159 @@
# ****************************************************************************
# $Revision: 11928 $ on $Date: 2010-07-13 09:04:56 -0700 (Tue, 13 Jul 2010) $
# cl_ext.h contains OpenCL extensions which don't have external
-# (OpenGL, D3D) dependencies.
+# (OpenGL, D3D) dependencies.
-when not(defined(__CL_EXT_H)):
- const
- __CL_EXT_H* = true
- when defined(__APPLE__):
- else:
+import "cl/cl"
+import "cl/cl_platform"
+{.deadCodeElim:on.}
+
+when defined(macosx):
+ nil
+else:
# cl_khr_fp64 extension - no extension #define since it has no functions
+ nil
+const
+ CL_DEVICE_DOUBLE_FP_CONFIG* = 0x00001032
+# cl_khr_fp16 extension - no extension #define since it has no functions
+const
+ CL_DEVICE_HALF_FP_CONFIG* = 0x00001033
+# Memory object destruction
+#
+# Apple extension for use to manage externally allocated buffers used with cl_mem objects with CL_MEM_USE_HOST_PTR
+#
+# Registers a user callback function that will be called when the memory object is deleted and its resources
+# freed. Each call to clSetMemObjectCallbackFn registers the specified user callback function on a callback
+# stack associated with memobj. The registered user callback functions are called in the reverse order in
+# which they were registered. The user callback functions are called and then the memory object is deleted
+# and its resources freed. This provides a mechanism for the application (and libraries) using memobj to be
+# notified when the memory referenced by host_ptr, specified when the memory object is created and used as
+# the storage bits for the memory object, can be reused or freed.
+#
+# The application may not call CL api's with the cl_mem object passed to the pfn_notify.
+#
+# Please check for the "cl_APPLE_SetMemObjectDestructor" extension using clGetDeviceInfo(CL_DEVICE_EXTENSIONS)
+# before using.
+#
+const
+ cl_APPLE_SetMemObjectDestructor* = 1
+#
+#TCLint clSetMemObjectDestructorAPPLE(cl_mem memobj,
+# void (* pfn_notify)( cl_mem memobj, void* user_data),
+# void * user_data ) ;
+#
+# Context Logging Functions
+#
+# The next three convenience functions are intended to be used as the pfn_notify parameter to clCreateContext().
+# Please check for the "cl_APPLE_ContextLoggingFunctions" extension using clGetDeviceInfo(CL_DEVICE_EXTENSIONS)
+# before using.
+#
+# clLogMessagesToSystemLog fowards on all log messages to the Apple System Logger
+#
+const
+ cl_APPLE_ContextLoggingFunctions* = 1
+proc clLogMessagesToSystemLogAPPLE*(a2: cstring, a3: pointer, a4: TCLsize_t, # cb
+ a5: pointer) {.importc: "clLogMessagesToSystemLogAPPLE", dynlib: cldll.}
+# clLogMessagesToStdout sends all log messages to the file descriptor stdout
+proc clLogMessagesToStdoutAPPLE*(a2: cstring, a3: pointer, a4: TCLsize_t, # cb
+ a5: pointer) {.importc: "clLogMessagesToStdoutAPPLE", dynlib: cldll.}
+# clLogMessagesToStderr sends all log messages to the file descriptor stderr
+proc clLogMessagesToStderrAPPLE*(a2: cstring, a3: pointer, a4: TCLsize_t, # cb
+ a5: pointer) {.importc: "clLogMessagesToStderrAPPLE", dynlib: cldll.}
+#***********************
+# cl_khr_icd extension *
+#**********************
+const
+ cl_khr_icd* = 1
+# cl_platform_info
+const
+ CL_PLATFORM_ICD_SUFFIX_KHR* = 0x00000920
+# Additional Error Codes
+const
+ CL_PLATFORM_NOT_FOUND_KHR* = - 1001
+proc clIcdGetPlatformIDsKHR*(a2: TCLuint, # num_entries
+ a3: ptr TCLPlatform_id, # platforms
+ a4: ptr TCLuint): TCLint {.importc: "clIcdGetPlatformIDsKHR", dynlib: cldll.}
+ # num_platforms
+type
+ TCLDevice_partition_property_ext* = TCLulong
+ clIcdGetPlatformIDsKHR_fn* = proc (a2: TCLuint, # num_entries
+ a3: ptr TCLPlatform_id, # platforms
+ a4: ptr TCLuint): TCLuint # num_platforms
+#*****************************************
+# cl_nv_device_attribute_query extension *
+#****************************************
+# cl_nv_device_attribute_query extension - no extension #define since it has no functions
+const
+ CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV* = 0x00004000
+ CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV* = 0x00004001
+ CL_DEVICE_REGISTERS_PER_BLOCK_NV* = 0x00004002
+ CL_DEVICE_WARP_SIZE_NV* = 0x00004003
+ CL_DEVICE_GPU_OVERLAP_NV* = 0x00004004
+ CL_DEVICE_KERNEL_EXEC_TIMEOUT_NV* = 0x00004005
+ CL_DEVICE_INTEGRATED_MEMORY_NV* = 0x00004006
+#********************************
+# cl_amd_device_attribute_query *
+#*******************************
+const
+ CL_DEVICE_PROFILING_TIMER_OFFSET_AMD* = 0x00004036
+when defined(CL_VERSION_1_1):
+ #**********************************
+ # cl_ext_device_fission extension *
+ # *********************************
const
- CL_DEVICE_DOUBLE_FP_CONFIG* = 0x00001032
- # cl_khr_fp16 extension - no extension #define since it has no functions
- const
- CL_DEVICE_HALF_FP_CONFIG* = 0x00001033
- # Memory object destruction
- #
- # Apple extension for use to manage externally allocated buffers used with cl_mem objects with CL_MEM_USE_HOST_PTR
- #
- # Registers a user callback function that will be called when the memory object is deleted and its resources
- # freed. Each call to clSetMemObjectCallbackFn registers the specified user callback function on a callback
- # stack associated with memobj. The registered user callback functions are called in the reverse order in
- # which they were registered. The user callback functions are called and then the memory object is deleted
- # and its resources freed. This provides a mechanism for the application (and libraries) using memobj to be
- # notified when the memory referenced by host_ptr, specified when the memory object is created and used as
- # the storage bits for the memory object, can be reused or freed.
- #
- # The application may not call CL api's with the cl_mem object passed to the pfn_notify.
- #
- # Please check for the "cl_APPLE_SetMemObjectDestructor" extension using clGetDeviceInfo(CL_DEVICE_EXTENSIONS)
- # before using.
- #
- const
- cl_APPLE_SetMemObjectDestructor* = 1
- #
- #cl_int clSetMemObjectDestructorAPPLE(cl_mem memobj,
- # void (* pfn_notify)( cl_mem memobj, void* user_data),
- # void * user_data ) ;
- #
- # Context Logging Functions
- #
- # The next three convenience functions are intended to be used as the pfn_notify parameter to clCreateContext().
- # Please check for the "cl_APPLE_ContextLoggingFunctions" extension using clGetDeviceInfo(CL_DEVICE_EXTENSIONS)
- # before using.
- #
- # clLogMessagesToSystemLog fowards on all log messages to the Apple System Logger
- #
- const
- cl_APPLE_ContextLoggingFunctions* = 1
- proc clLogMessagesToSystemLogAPPLE*(a2: cstring, a3: pointer, a4: size_t, # cb
- a5: pointer)
- # clLogMessagesToStdout sends all log messages to the file descriptor stdout
- proc clLogMessagesToStdoutAPPLE*(a2: cstring, a3: pointer, a4: size_t, # cb
- a5: pointer)
- # clLogMessagesToStderr sends all log messages to the file descriptor stderr
- proc clLogMessagesToStderrAPPLE*(a2: cstring, a3: pointer, a4: size_t, # cb
- a5: pointer)
- #***********************
- # cl_khr_icd extension *
- #**********************
+ cl_ext_device_fission* = 1
+ proc clReleaseDeviceEXT*(a2: TCLDevice_id): TCLint {.importc: "clIcdGetPlatformIDsKHR", dynlib: cldll.}
+ #device
+ type
+ clReleaseDeviceEXT_fn* = proc (a2: TCLDevice_id): TCLint #device
+ proc clRetainDeviceEXT*(a2: TCLDevice_id): TCLint {.importc: "clRetainDeviceEXT", dynlib: cldll.}
+ #device
+ type
+ clRetainDeviceEXT_fn* = proc (a2: TCLDevice_id): TCLint #device
+ cl_device_partition_property_ext* = TCLulong
+ proc clCreateSubDevicesEXT*(a2: TCLDevice_id, #in_device
+ a3: ptr cl_device_partition_property_ext, #
+ # properties
+ a4: TCLuint, #num_entries
+ a5: ptr TCLDevice_id, #out_devices
+ a6: ptr TCLuint): TCLint {.importc: "clCreateSubDevicesEXT", dynlib: cldll.}
+ #num_devices
+ type
+ clCreateSubDevicesEXT_fn* = proc (a2: TCLDevice_id, #in_device
+ a3: ptr TCLDevice_partition_property_ext, #
+ # properties
+ a4: TCLuint, #num_entries
+ a5: ptr TCLDevice_id, #out_devices
+ a6: ptr TCLuint): TCLint #num_devices
+ # cl_device_partition_property_ext
const
- cl_khr_icd* = 1
- # cl_platform_info
+ CL_DEVICE_PARTITION_EQUALLY_EXT* = 0x00004050
+ CL_DEVICE_PARTITION_BY_COUNTS_EXT* = 0x00004051
+ CL_DEVICE_PARTITION_BY_NAMES_EXT* = 0x00004052
+ CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN_EXT* = 0x00004053
+ # clDeviceGetInfo selectors
const
- CL_PLATFORM_ICD_SUFFIX_KHR* = 0x00000920
- # Additional Error Codes
+ CL_DEVICE_PARENT_DEVICE_EXT* = 0x00004054
+ CL_DEVICE_PARTITION_TYPES_EXT* = 0x00004055
+ CL_DEVICE_AFFINITY_DOMAINS_EXT* = 0x00004056
+ CL_DEVICE_REFERENCE_COUNT_EXT* = 0x00004057
+ CL_DEVICE_PARTITION_STYLE_EXT* = 0x00004058
+ # error codes
const
- CL_PLATFORM_NOT_FOUND_KHR* = - 1001
- proc clIcdGetPlatformIDsKHR*(a2: cl_uint, # num_entries
- a3: ptr cl_platform_id, # platforms
- a4: ptr cl_uint): cl_int
- # num_platforms
- type
- clIcdGetPlatformIDsKHR_fn* = proc (a2: cl_uint, # num_entries
- a3: ptr cl_platform_id, # platforms
- a4: ptr cl_uint): cl_int # num_platforms
- #*****************************************
- # cl_nv_device_attribute_query extension *
- #****************************************
- # cl_nv_device_attribute_query extension - no extension #define since it has no functions
+ CL_DEVICE_PARTITION_FAILED_EXT* = - 1057
+ CL_INVALID_PARTITION_COUNT_EXT* = - 1058
+ CL_INVALID_PARTITION_NAME_EXT* = - 1059
+ # CL_AFFINITY_DOMAINs
const
- CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV* = 0x00004000
- CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV* = 0x00004001
- CL_DEVICE_REGISTERS_PER_BLOCK_NV* = 0x00004002
- CL_DEVICE_WARP_SIZE_NV* = 0x00004003
- CL_DEVICE_GPU_OVERLAP_NV* = 0x00004004
- CL_DEVICE_KERNEL_EXEC_TIMEOUT_NV* = 0x00004005
- CL_DEVICE_INTEGRATED_MEMORY_NV* = 0x00004006
- #********************************
- # cl_amd_device_attribute_query *
- #*******************************
+ CL_AFFINITY_DOMAIN_L1_CACHE_EXT* = 0x00000001
+ CL_AFFINITY_DOMAIN_L2_CACHE_EXT* = 0x00000002
+ CL_AFFINITY_DOMAIN_L3_CACHE_EXT* = 0x00000003
+ CL_AFFINITY_DOMAIN_L4_CACHE_EXT* = 0x00000004
+ CL_AFFINITY_DOMAIN_NUMA_EXT* = 0x00000010
+ CL_AFFINITY_DOMAIN_NEXT_FISSIONABLE_EXT* = 0x00000100
+ # cl_device_partition_property_ext list terminators
const
- CL_DEVICE_PROFILING_TIMER_OFFSET_AMD* = 0x00004036
- when defined(CL_VERSION_1_1):
- #**********************************
- # cl_ext_device_fission extension *
- # *********************************
- const
- cl_ext_device_fission* = 1
- proc clReleaseDeviceEXT*(a2: cl_device_id): cl_int
- #device
- type
- clReleaseDeviceEXT_fn* = proc (a2: cl_device_id): cl_int #device
- proc clRetainDeviceEXT*(a2: cl_device_id): cl_int
- #device
- type
- clRetainDeviceEXT_fn* = proc (a2: cl_device_id): cl_int #device
- cl_device_partition_property_ext* = cl_ulong
- proc clCreateSubDevicesEXT*(a2: cl_device_id, #in_device
- a3: ptr cl_device_partition_property_ext, #
- # properties
- a4: cl_uint, #num_entries
- a5: ptr cl_device_id, #out_devices
- a6: ptr cl_uint): cl_int
- #num_devices
- type
- clCreateSubDevicesEXT_fn* = proc (a2: cl_device_id, #in_device
- a3: ptr cl_device_partition_property_ext, #
- # properties
- a4: cl_uint, #num_entries
- a5: ptr cl_device_id, #out_devices
- a6: ptr cl_uint): cl_int #num_devices
- # cl_device_partition_property_ext
- const
- CL_DEVICE_PARTITION_EQUALLY_EXT* = 0x00004050
- CL_DEVICE_PARTITION_BY_COUNTS_EXT* = 0x00004051
- CL_DEVICE_PARTITION_BY_NAMES_EXT* = 0x00004052
- CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN_EXT* = 0x00004053
- # clDeviceGetInfo selectors
- const
- CL_DEVICE_PARENT_DEVICE_EXT* = 0x00004054
- CL_DEVICE_PARTITION_TYPES_EXT* = 0x00004055
- CL_DEVICE_AFFINITY_DOMAINS_EXT* = 0x00004056
- CL_DEVICE_REFERENCE_COUNT_EXT* = 0x00004057
- CL_DEVICE_PARTITION_STYLE_EXT* = 0x00004058
- # error codes
- const
- CL_DEVICE_PARTITION_FAILED_EXT* = - 1057
- CL_INVALID_PARTITION_COUNT_EXT* = - 1058
- CL_INVALID_PARTITION_NAME_EXT* = - 1059
- # CL_AFFINITY_DOMAINs
- const
- CL_AFFINITY_DOMAIN_L1_CACHE_EXT* = 0x00000001
- CL_AFFINITY_DOMAIN_L2_CACHE_EXT* = 0x00000002
- CL_AFFINITY_DOMAIN_L3_CACHE_EXT* = 0x00000003
- CL_AFFINITY_DOMAIN_L4_CACHE_EXT* = 0x00000004
- CL_AFFINITY_DOMAIN_NUMA_EXT* = 0x00000010
- CL_AFFINITY_DOMAIN_NEXT_FISSIONABLE_EXT* = 0x00000100
- # cl_device_partition_property_ext list terminators
- const
- CL_PROPERTIES_LIST_END_EXT* = cast[(cl_device_partition_property_ext)](0)
- CL_PARTITION_BY_COUNTS_LIST_END_EXT* = cast[(
- cl_device_partition_property_ext)](0)
- ##define CL_PARTITION_BY_NAMES_LIST_END_EXT ((cl_device_partition_property_ext) 0 - 1)
+ CL_PROPERTIES_LIST_END_EXT* = cast[(cl_device_partition_property_ext)](0)
+ CL_PARTITION_BY_COUNTS_LIST_END_EXT* = cast[(
+ cl_device_partition_property_ext)](0)
+ ##define CL_PARTITION_BY_NAMES_LIST_END_EXT ((cl_device_partition_property_ext) 0 - 1)
View
19 cl/cl_gl.nim
@@ -31,6 +31,7 @@ import "cl/cl"
import "cl/cl_platform"
{.push callConv: stdcall.}
+{.deadCodeElim:on.}
when not(defined(OPENCL_CL_GL_H)):
const
@@ -58,50 +59,50 @@ when not(defined(OPENCL_CL_GL_H)):
proc clCreateFromGLBuffer*(a2: TCLContext, # context
a3: TCLMem_flags, # flags
a4: cl_GLuint, # bufobj
- a5: ptr cint): TCLMem {.importc: "clCreateFromGLBuffer", dynlib: "libOpenCL.so".}
+ a5: ptr cint): TCLMem {.importc: "clCreateFromGLBuffer", dynlib: cldll.}
# errcode_ret
proc clCreateFromGLTexture2D*(a2: TCLContext, # context
a3: TCLMem_flags, # flags
a4: cl_GLenum, # target
a5: cl_GLint, # miplevel
a6: cl_GLuint, # texture
- a7: ptr TCLInt): TCLMem {.importc: "clCreateFromGLTexture2D", dynlib: "libOpenCL.so".}
+ a7: ptr TCLInt): TCLMem {.importc: "clCreateFromGLTexture2D", dynlib: cldll.}
# errcode_ret
proc clCreateFromGLTexture3D*(a2: TCLContext, # context
a3: TCLMem_flags, # flags
a4: cl_GLenum, # target
a5: cl_GLint, # miplevel
a6: cl_GLuint, # texture
- a7: ptr TCLInt): TCLMem {.importc: "clCreateFromGLTexture3D", dynlib: "libOpenCL.so".}
+ a7: ptr TCLInt): TCLMem {.importc: "clCreateFromGLTexture3D", dynlib: cldll.}
# errcode_ret
proc clCreateFromGLRenderbuffer*(a2: TCLContext, # context
a3: TCLMem_flags, # flags
a4: cl_GLuint, # renderbuffer
- a5: ptr TCLInt): TCLMem {.importc: "clCreateFromGLRenderbuffer", dynlib: "libOpenCL.so".}
+ a5: ptr TCLInt): TCLMem {.importc: "clCreateFromGLRenderbuffer", dynlib: cldll.}
# errcode_ret
proc clGetGLObjectInfo*(a2: TCLMem, # memobj
a3: ptr TCLGL_object_type, # gl_object_type
- a4: ptr cl_GLuint): TCLInt {.importc: "clGetGLObjectInfo", dynlib: "libOpenCL.so".}
+ a4: ptr cl_GLuint): TCLInt {.importc: "clGetGLObjectInfo", dynlib: cldll.}
# gl_object_name
proc clGetGLTextureInfo*(a2: TCLMem, # memobj
a3: TCLGL_texture_info, # param_name
a4: TCLSize_t, # param_value_size
a5: pointer,
- a6: ptr TCLSize_t): TCLInt {.importc: "clGetGLTextureInfo", dynlib: "libOpenCL.so".}
+ a6: ptr TCLSize_t): TCLInt {.importc: "clGetGLTextureInfo", dynlib: cldll.}
# param_value_size_ret
proc clEnqueueAcquireGLObjects*(a2: TCLCommand_queue, # command_queue
a3: TCLUint, # num_objects
a4: ptr TCLMem, # mem_objects
a5: TCLUint, # num_events_in_wait_list
a6: ptr TCLEvent, # event_wait_list
- a7: ptr TCLEvent): TCLInt {.importc: "clEnqueueAcquireGLObjects", dynlib: "libOpenCL.so".}
+ a7: ptr TCLEvent): TCLInt {.importc: "clEnqueueAcquireGLObjects", dynlib: cldll.}
# event
proc clEnqueueReleaseGLObjects*(a2: TCLCommand_queue, # command_queue
a3: TCLUint, # num_objects
a4: ptr TCLMem, # mem_objects
a5: TCLUint, # num_events_in_wait_list
a6: ptr TCLEvent, # event_wait_list
- a7: ptr TCLEvent): TCLInt {.importc: "clEnqueueReleaseGLObjects", dynlib: "libOpenCL.so".}
+ a7: ptr TCLEvent): TCLInt {.importc: "clEnqueueReleaseGLObjects", dynlib: cldll.}
# event
# cl_khr_gl_sharing extension
const
@@ -125,7 +126,7 @@ when not(defined(OPENCL_CL_GL_H)):
proc clGetGLContextInfoKHR*(a2: ptr TCLContext_properties, # properties
a3: TCLGL_context_info, # param_name
a4: int, # param_value_size
- a5: pointer, a6: ptr int): TCLInt {.importc: "clGetGLContextInfoKHR", dynlib: "libOpenCL.so".}
+ a5: pointer, a6: ptr int): TCLInt {.importc: "clGetGLContextInfoKHR", dynlib: cldll.}
# param_value_size_ret
type
clGetGLContextInfoKHR_fn* = proc (properties: ptr TCLContext_properties,
View
1  cl/cl_gl_ext.nim
@@ -27,6 +27,7 @@
import "cl/cl"
import "cl/cl_gl"
import "cl/cl_platform"
+{.deadCodeElim:on.}
#
# For each extension, follow this template
View
2,272 cl/cl_platform.nim
@@ -22,1167 +22,1165 @@
# ********************************************************************************
# $Revision: 11803 $ on $Date: 2010-06-25 10:02:12 -0700 (Fri, 25 Jun 2010) $
-when not(defined(CL_PLATFORM_H)):
+when defined(macosx):
+ nil
+ # Contains #defines for AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER below
+when defined(windows):
const
- CL_PLATFORM_H* = true
- when defined(macosx):
- # Contains #defines for AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER below
- when defined(windows):
+ CL_API_ENTRY* = true
+ #CL_API_CALL* = __stdcall
+ #CL_CALLBACK* = __stdcall
+else:
+ const
+ CL_API_ENTRY* = true
+ CL_API_CALL* = true
+ CL_CALLBACK* = true
+when (defined(windows)):
+ # scalar types
+ #
+ #typedef signed __int8 cl_char;
+ #typedef unsigned __int8 cl_uchar;
+ #typedef signed __int16 cl_short;
+ #typedef unsigned __int16 cl_ushort;
+ #typedef signed __int32 cl_int;
+ #typedef unsigned __int32 cl_uint;
+ #typedef signed __int64 cl_long;
+ #typedef unsigned __int64 cl_ulong;
+ #
+ #typedef unsigned __int16 cl_half;
+ #typedef float cl_float;
+ #typedef double cl_double;
+ #
+ # Macro names and corresponding values defined by OpenCL
+ #
+ ##define CL_CHAR_BIT 8
+ ##define CL_SCHAR_MAX 127
+ ##define CL_SCHAR_MIN (-127-1)
+ ##define CL_CHAR_MAX CL_SCHAR_MAX
+ ##define CL_CHAR_MIN CL_SCHAR_MIN
+ ##define CL_UCHAR_MAX 255
+ ##define CL_SHRT_MAX 32767
+ ##define CL_SHRT_MIN (-32767-1)
+ ##define CL_USHRT_MAX 65535
+ ##define CL_INT_MAX 2147483647
+ ##define CL_INT_MIN (-2147483647-1)
+ ##define CL_UINT_MAX 0xffffffffU
+ ##define CL_LONG_MAX ((cl_long) 0x7FFFFFFFFFFFFFFFLL)
+ ##define CL_LONG_MIN ((cl_long) -0x7FFFFFFFFFFFFFFFLL - 1LL)
+ ##define CL_ULONG_MAX ((cl_ulong) 0xFFFFFFFFFFFFFFFFULL)
+ #
+ ##define CL_FLT_DIG 6
+ ##define CL_FLT_MANT_DIG 24
+ ##define CL_FLT_MAX_10_EXP +38
+ ##define CL_FLT_MAX_EXP +128
+ ##define CL_FLT_MIN_10_EXP -37
+ ##define CL_FLT_MIN_EXP -125
+ ##define CL_FLT_RADIX 2
+ ##define CL_FLT_MAX 340282346638528859811704183484516925440.0f
+ ##define CL_FLT_MIN 1.175494350822287507969e-38f
+ ##define CL_FLT_EPSILON 0x1.0p-23f
+ #
+ ##define CL_DBL_DIG 15
+ ##define CL_DBL_MANT_DIG 53
+ ##define CL_DBL_MAX_10_EXP +308
+ ##define CL_DBL_MAX_EXP +1024
+ ##define CL_DBL_MIN_10_EXP -307
+ ##define CL_DBL_MIN_EXP -1021
+ ##define CL_DBL_RADIX 2
+ ##define CL_DBL_MAX
+ #179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0
+ ##define CL_DBL_MIN 2.225073858507201383090e-308
+ ##define CL_DBL_EPSILON 2.220446049250313080847e-16
+ #
+ ##define CL_M_E 2.718281828459045090796
+ ##define CL_M_LOG2E 1.442695040888963387005
+ ##define CL_M_LOG10E 0.434294481903251816668
+ ##define CL_M_LN2 0.693147180559945286227
+ ##define CL_M_LN10 2.302585092994045901094
+ ##define CL_M_PI 3.141592653589793115998
+ ##define CL_M_PI_2 1.570796326794896557999
+ ##define CL_M_PI_4 0.785398163397448278999
+ ##define CL_M_1_PI 0.318309886183790691216
+ ##define CL_M_2_PI 0.636619772367581382433
+ ##define CL_M_2_SQRTPI 1.128379167095512558561
+ ##define CL_M_SQRT2 1.414213562373095145475
+ ##define CL_M_SQRT1_2 0.707106781186547572737
+ #
+ ##define CL_M_E_F 2.71828174591064f
+ ##define CL_M_LOG2E_F 1.44269502162933f
+ ##define CL_M_LOG10E_F 0.43429449200630f
+ ##define CL_M_LN2_F 0.69314718246460f
+ ##define CL_M_LN10_F 2.30258512496948f
+ ##define CL_M_PI_F 3.14159274101257f
+ ##define CL_M_PI_2_F 1.57079637050629f
+ ##define CL_M_PI_4_F 0.78539818525314f
+ ##define CL_M_1_PI_F 0.31830987334251f
+ ##define CL_M_2_PI_F 0.63661974668503f
+ ##define CL_M_2_SQRTPI_F 1.12837922573090f
+ ##define CL_M_SQRT2_F 1.41421353816986f
+ ##define CL_M_SQRT1_2_F 0.70710676908493f
+ #
+ ##define CL_NAN (CL_INFINITY - CL_INFINITY)
+ ##define CL_HUGE_VALF ((cl_float) 1e50)
+ ##define CL_HUGE_VAL ((cl_double) 1e500)
+ ##define CL_MAXFLOAT CL_FLT_MAX
+ ##define CL_INFINITY CL_HUGE_VALF
+ #
+else:
+ type
+ TCLchar* = char
+ TCLuchar* = char
+ TCLshort* = cshort
+ TCLushort* = cshort
+ TCLint* = cint
+ TCLuint* = cint
+ TCLlong* = clong
+ TCLulong* = clong
+ TCLhalf* = cshort
+ TCLfloat = float32
+ TCLdouble = float64
+
+ # scalar types
+ #
+ #typedef int8_t cl_char;
+ #typedef uint8_t cl_uchar;
+ #typedef int16_t cl_short __attribute__((aligned(2)));
+ #typedef uint16_t cl_ushort __attribute__((aligned(2)));
+ #typedef int32_t cl_int __attribute__((aligned(4)));
+ #typedef uint32_t cl_uint __attribute__((aligned(4)));
+ #typedef int64_t cl_long __attribute__((aligned(8)));
+ #typedef uint64_t cl_ulong __attribute__((aligned(8)));
+ #
+ #typedef uint16_t cl_half __attribute__((aligned(2)));
+ #typedef float cl_float __attribute__((aligned(4)));
+ #typedef double cl_double __attribute__((aligned(8)));
+ #
+ # Macro names and corresponding values defined by OpenCL
+ const
+ CL_CHAR_BIT* = 8
+ CL_SCHAR_MAX* = 127
+ CL_SCHAR_MIN* = (- 127 - 1)
+ CL_CHAR_MAX* = CL_SCHAR_MAX
+ CL_CHAR_MIN* = CL_SCHAR_MIN
+ CL_UCHAR_MAX* = 255
+ CL_SHRT_MAX* = 32767
+ CL_SHRT_MIN* = (- 32767 - 1)
+ CL_USHRT_MAX* = 65535
+ CL_INT_MAX* = 2147483647
+ CL_INT_MIN* = (- 2147483647 - 1)
+ CL_UINT_MAX* = 0xFFFFFFFF
+ CL_LONG_MAX* = cast[(TCLlong)](0x7FFFFFFFFFFFFFFF'i64)
+ #CL_LONG_MIN* = ((TCLlong) - 0x7FFFFFFFFFFFFFFF'i64 - 1)
+ CL_ULONG_MAX* = cast[(TCLlong)](0xFFFFFFFFFFFFFFFF'i64)
+ CL_FLT_DIG* = 6
+ CL_FLT_MANT_DIG* = 24
+ CL_FLT_MAX_10_EXP* = + 38
+ CL_FLT_MAX_EXP* = + 128
+ CL_FLT_MIN_10_EXP* = - 37
+ CL_FLT_MIN_EXP* = - 125
+ CL_FLT_RADIX* = 2
+ #CL_FLT_MAX* = 0x00000001.fffffep127f
+ ##define CL_FLT_MIN 0x1.0p-126f
+ ##define CL_FLT_EPSILON 0x1.0p-23f
+ const
+ CL_DBL_DIG* = 15
+ CL_DBL_MANT_DIG* = 53
+ CL_DBL_MAX_10_EXP* = + 308
+ CL_DBL_MAX_EXP* = + 1024
+ CL_DBL_MIN_10_EXP* = - 307
+ CL_DBL_MIN_EXP* = - 1021
+ CL_DBL_RADIX* = 2
+ #CL_DBL_MAX* = 0x00000001.fffffffffffffp1023
+ ##define CL_DBL_MIN 0x1.0p-1022
+ ##define CL_DBL_EPSILON 0x1.0p-52
+ const
+ CL_M_E* = 2.7182818284590451e+00
+ CL_M_LOG2E* = 1.4426950408889632e+00
+ CL_M_LOG10E* = 4.3429448190325187e-01
+ CL_M_LN2* = 6.9314718055994518e-01
+ CL_M_LN10* = 2.3025850929940455e+00
+ CL_M_PI* = 3.1415926535897927e+00
+ CL_M_PI_2* = 1.5707963267948963e+00
+ CL_M_PI_4* = 7.8539816339744817e-01
+ CL_M_1_PI* = 3.1830988618379064e-01
+ CL_M_2_PI* = 6.3661977236758127e-01
+ CL_M_2_SQRTPI* = 1.1283791670955123e+00
+ CL_M_SQRT2* = 1.4142135623730954e+00
+ CL_M_SQRT1_2* = 7.0710678118654768e-01
+ CL_M_E_F* = 2.7182817459106401e+00
+ CL_M_LOG2E_F* = 1.4426950216293299e+00
+ CL_M_LOG10E_F* = 4.3429449200629999e-01
+ CL_M_LN2_F* = 6.9314718246460005e-01
+ CL_M_LN10_F* = 2.3025851249694802e+00
+ CL_M_PI_F* = 3.1415927410125701e+00
+ CL_M_PI_2_F* = 1.5707963705062900e+00
+ CL_M_PI_4_F* = 7.8539818525313998e-01
+ CL_M_1_PI_F* = 3.1830987334250999e-01
+ CL_M_2_PI_F* = 6.3661974668502996e-01
+ CL_M_2_SQRTPI_F* = 1.1283792257309000e+00
+ CL_M_SQRT2_F* = 1.4142135381698600e+00
+ CL_M_SQRT1_2_F* = 7.0710676908492998e-01
+ when defined(GNUC):
const
- CL_API_ENTRY* = true
- #CL_API_CALL* = __stdcall
- #CL_CALLBACK* = __stdcall
+ #CL_HUGE_VALF* = __builtin_huge_valf()
+ #CL_HUGE_VAL* = __builtin_huge_val()
+ #CL_NAN* = __builtin_nanf("")
else:
+ ##define CL_HUGE_VALF ((cl_float) 1e50)
+ ##define CL_HUGE_VAL ((cl_double) 1e500)
+ proc nanf*(a2: cstring): cfloat =
+ nil
const
- CL_API_ENTRY* = true
- CL_API_CALL* = true
- CL_CALLBACK* = true
- when (defined(windows))):
- # scalar types
- #
- #typedef signed __int8 cl_char;
- #typedef unsigned __int8 cl_uchar;
- #typedef signed __int16 cl_short;
- #typedef unsigned __int16 cl_ushort;
- #typedef signed __int32 cl_int;
- #typedef unsigned __int32 cl_uint;
- #typedef signed __int64 cl_long;
- #typedef unsigned __int64 cl_ulong;
- #
- #typedef unsigned __int16 cl_half;
- #typedef float cl_float;
- #typedef double cl_double;
- #
- # Macro names and corresponding values defined by OpenCL
- #
- ##define CL_CHAR_BIT 8
- ##define CL_SCHAR_MAX 127
- ##define CL_SCHAR_MIN (-127-1)
- ##define CL_CHAR_MAX CL_SCHAR_MAX
- ##define CL_CHAR_MIN CL_SCHAR_MIN
- ##define CL_UCHAR_MAX 255
- ##define CL_SHRT_MAX 32767
- ##define CL_SHRT_MIN (-32767-1)
- ##define CL_USHRT_MAX 65535
- ##define CL_INT_MAX 2147483647
- ##define CL_INT_MIN (-2147483647-1)
- ##define CL_UINT_MAX 0xffffffffU
- ##define CL_LONG_MAX ((cl_long) 0x7FFFFFFFFFFFFFFFLL)
- ##define CL_LONG_MIN ((cl_long) -0x7FFFFFFFFFFFFFFFLL - 1LL)
- ##define CL_ULONG_MAX ((cl_ulong) 0xFFFFFFFFFFFFFFFFULL)
- #
- ##define CL_FLT_DIG 6
- ##define CL_FLT_MANT_DIG 24
- ##define CL_FLT_MAX_10_EXP +38
- ##define CL_FLT_MAX_EXP +128
- ##define CL_FLT_MIN_10_EXP -37
- ##define CL_FLT_MIN_EXP -125
- ##define CL_FLT_RADIX 2
- ##define CL_FLT_MAX 340282346638528859811704183484516925440.0f
- ##define CL_FLT_MIN 1.175494350822287507969e-38f
- ##define CL_FLT_EPSILON 0x1.0p-23f
- #
- ##define CL_DBL_DIG 15
- ##define CL_DBL_MANT_DIG 53
- ##define CL_DBL_MAX_10_EXP +308
- ##define CL_DBL_MAX_EXP +1024
- ##define CL_DBL_MIN_10_EXP -307
- ##define CL_DBL_MIN_EXP -1021
- ##define CL_DBL_RADIX 2
- ##define CL_DBL_MAX
- #179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0
- ##define CL_DBL_MIN 2.225073858507201383090e-308
- ##define CL_DBL_EPSILON 2.220446049250313080847e-16
- #
- ##define CL_M_E 2.718281828459045090796
- ##define CL_M_LOG2E 1.442695040888963387005
- ##define CL_M_LOG10E 0.434294481903251816668
- ##define CL_M_LN2 0.693147180559945286227
- ##define CL_M_LN10 2.302585092994045901094
- ##define CL_M_PI 3.141592653589793115998
- ##define CL_M_PI_2 1.570796326794896557999
- ##define CL_M_PI_4 0.785398163397448278999
- ##define CL_M_1_PI 0.318309886183790691216
- ##define CL_M_2_PI 0.636619772367581382433
- ##define CL_M_2_SQRTPI 1.128379167095512558561
- ##define CL_M_SQRT2 1.414213562373095145475
- ##define CL_M_SQRT1_2 0.707106781186547572737
- #
- ##define CL_M_E_F 2.71828174591064f
- ##define CL_M_LOG2E_F 1.44269502162933f
- ##define CL_M_LOG10E_F 0.43429449200630f
- ##define CL_M_LN2_F 0.69314718246460f
- ##define CL_M_LN10_F 2.30258512496948f
- ##define CL_M_PI_F 3.14159274101257f
- ##define CL_M_PI_2_F 1.57079637050629f
- ##define CL_M_PI_4_F 0.78539818525314f
- ##define CL_M_1_PI_F 0.31830987334251f
- ##define CL_M_2_PI_F 0.63661974668503f
- ##define CL_M_2_SQRTPI_F 1.12837922573090f
- ##define CL_M_SQRT2_F 1.41421353816986f
- ##define CL_M_SQRT1_2_F 0.70710676908493f
- #
- ##define CL_NAN (CL_INFINITY - CL_INFINITY)
- ##define CL_HUGE_VALF ((cl_float) 1e50)
- ##define CL_HUGE_VAL ((cl_double) 1e500)
- ##define CL_MAXFLOAT CL_FLT_MAX
- ##define CL_INFINITY CL_HUGE_VALF
- #
+ #CL_NAN* = nanf("")
+ const
+ #CL_MAXFLOAT* = CL_FLT_MAX
+ #CL_INFINITY* = CL_HUGE_VALF
+# Mirror types to GL types. Mirror types allow us to avoid deciding which headers to load based on whether we are using GL or GLES here.
+type
+ cl_GLuint* = cint
+ cl_GLint* = cint
+ cl_GLenum* = cint
+#
+# Vector types
+#
+# Note: OpenCL requires that all types be naturally aligned.
+# This means that vector types must be naturally aligned.
+# For example, a vector of four floats must be aligned to
+# a 16 byte boundary (calculated as 4 * the natural 4-byte
+# alignment of the float). The alignment qualifiers here
+# will only function properly if your compiler supports them
+# and if you don't actively work to defeat them. For example,
+# in order for a cl_float4 to be 16 byte aligned in a struct,
+# the start of the struct must itself be 16-byte aligned.
+#
+# Maintaining proper alignment is the user's responsibility.
+#
+# Define basic vector types
+when defined(VEC):
+ #
+ # typedef vector unsigned char __cl_uchar16;
+ # typedef vector signed char __cl_char16;
+ # typedef vector unsigned short __cl_ushort8;
+ # typedef vector signed short __cl_short8;
+ # typedef vector unsigned int __cl_uint4;
+ # typedef vector signed int __cl_int4;
+ # typedef vector float __cl_float4;
+ #
+ const
+ CL_UCHAR16* = 1
+ CL_CHAR16* = 1
+ CL_USHORT8* = 1
+ CL_SHORT8* = 1
+ CL_UINT4* = 1
+ CL_INT4* = 1
+ CL_FLOAT4* = 1
+when defined(SSE):
+ when defined(MINGW64):
+ nil
else:
- type
- TCLchar* = char
- TCLUchar* = char
- TCLShort* = cshort
- TCLUshort* = cshort
- TCLInt* = cint
- TCLUint* = cint
- TCLLong* = clong
- TCLUlong* = clong
- TCLHalf* = cshort
- TCLFloat = float32
- TCLDouble = float64
-
- # scalar types
- #
- #typedef int8_t cl_char;
- #typedef uint8_t cl_uchar;
- #typedef int16_t cl_short __attribute__((aligned(2)));
- #typedef uint16_t cl_ushort __attribute__((aligned(2)));
- #typedef int32_t cl_int __attribute__((aligned(4)));
- #typedef uint32_t cl_uint __attribute__((aligned(4)));
- #typedef int64_t cl_long __attribute__((aligned(8)));
- #typedef uint64_t cl_ulong __attribute__((aligned(8)));
- #
- #typedef uint16_t cl_half __attribute__((aligned(2)));
- #typedef float cl_float __attribute__((aligned(4)));
- #typedef double cl_double __attribute__((aligned(8)));
- #
- # Macro names and corresponding values defined by OpenCL
- const
- CL_CHAR_BIT* = 8
- CL_SCHAR_MAX* = 127
- CL_SCHAR_MIN* = (- 127 - 1)
- CL_CHAR_MAX* = CL_SCHAR_MAX
- CL_CHAR_MIN* = CL_SCHAR_MIN
- CL_UCHAR_MAX* = 255
- CL_SHRT_MAX* = 32767
- CL_SHRT_MIN* = (- 32767 - 1)
- CL_USHRT_MAX* = 65535
- CL_INT_MAX* = 2147483647
- CL_INT_MIN* = (- 2147483647 - 1)
- CL_UINT_MAX* = 0xFFFFFFFF
- CL_LONG_MAX* = cast[(TCLLong)](0x7FFFFFFFFFFFFFFF'i64)
- #CL_LONG_MIN* = ((TCLLong) - 0x7FFFFFFFFFFFFFFF'i64 - 1)
- CL_ULONG_MAX* = cast[(TCLLong)](0xFFFFFFFFFFFFFFFF'i64)
- CL_FLT_DIG* = 6
- CL_FLT_MANT_DIG* = 24
- CL_FLT_MAX_10_EXP* = + 38
- CL_FLT_MAX_EXP* = + 128
- CL_FLT_MIN_10_EXP* = - 37
- CL_FLT_MIN_EXP* = - 125
- CL_FLT_RADIX* = 2
- #CL_FLT_MAX* = 0x00000001.fffffep127f
- ##define CL_FLT_MIN 0x1.0p-126f
- ##define CL_FLT_EPSILON 0x1.0p-23f
- const
- CL_DBL_DIG* = 15
- CL_DBL_MANT_DIG* = 53
- CL_DBL_MAX_10_EXP* = + 308
- CL_DBL_MAX_EXP* = + 1024
- CL_DBL_MIN_10_EXP* = - 307
- CL_DBL_MIN_EXP* = - 1021
- CL_DBL_RADIX* = 2
- #CL_DBL_MAX* = 0x00000001.fffffffffffffp1023
- ##define CL_DBL_MIN 0x1.0p-1022
- ##define CL_DBL_EPSILON 0x1.0p-52
- const
- CL_M_E* = 2.7182818284590451e+00
- CL_M_LOG2E* = 1.4426950408889632e+00
- CL_M_LOG10E* = 4.3429448190325187e-01
- CL_M_LN2* = 6.9314718055994518e-01
- CL_M_LN10* = 2.3025850929940455e+00
- CL_M_PI* = 3.1415926535897927e+00
- CL_M_PI_2* = 1.5707963267948963e+00
- CL_M_PI_4* = 7.8539816339744817e-01
- CL_M_1_PI* = 3.1830988618379064e-01
- CL_M_2_PI* = 6.3661977236758127e-01
- CL_M_2_SQRTPI* = 1.1283791670955123e+00
- CL_M_SQRT2* = 1.4142135623730954e+00
- CL_M_SQRT1_2* = 7.0710678118654768e-01
- CL_M_E_F* = 2.7182817459106401e+00
- CL_M_LOG2E_F* = 1.4426950216293299e+00
- CL_M_LOG10E_F* = 4.3429449200629999e-01
- CL_M_LN2_F* = 6.9314718246460005e-01
- CL_M_LN10_F* = 2.3025851249694802e+00
- CL_M_PI_F* = 3.1415927410125701e+00
- CL_M_PI_2_F* = 1.5707963705062900e+00
- CL_M_PI_4_F* = 7.8539818525313998e-01
- CL_M_1_PI_F* = 3.1830987334250999e-01
- CL_M_2_PI_F* = 6.3661974668502996e-01
- CL_M_2_SQRTPI_F* = 1.1283792257309000e+00
- CL_M_SQRT2_F* = 1.4142135381698600e+00
- CL_M_SQRT1_2_F* = 7.0710676908492998e-01
when defined(GNUC):
- const
- #CL_HUGE_VALF* = __builtin_huge_valf()
- #CL_HUGE_VAL* = __builtin_huge_val()
- #CL_NAN* = __builtin_nanf("")
+ #typedef float __cl_float4 __attribute__((vector_size(16)));
else:
- ##define CL_HUGE_VALF ((cl_float) 1e50)
- ##define CL_HUGE_VAL ((cl_double) 1e500)
- proc nanf*(a2: cstring): cfloat =
- nil
- const
- #CL_NAN* = nanf("")
+ type
+ cl_float4* = m128
const
- #CL_MAXFLOAT* = CL_FLT_MAX
- #CL_INFINITY* = CL_HUGE_VALF
- # Mirror types to GL types. Mirror types allow us to avoid deciding which headers to load based on whether we are using GL or GLES here.
- type
- cl_GLuint* = cint
- cl_GLint* = cint
- cl_GLenum* = cint
- #
- # Vector types
- #
- # Note: OpenCL requires that all types be naturally aligned.
- # This means that vector types must be naturally aligned.
- # For example, a vector of four floats must be aligned to
- # a 16 byte boundary (calculated as 4 * the natural 4-byte
- # alignment of the float). The alignment qualifiers here
- # will only function properly if your compiler supports them
- # and if you don't actively work to defeat them. For example,
- # in order for a cl_float4 to be 16 byte aligned in a struct,
- # the start of the struct must itself be 16-byte aligned.
- #
- # Maintaining proper alignment is the user's responsibility.
- #
- # Define basic vector types
- when defined(VEC):
- #
- # typedef vector unsigned char __cl_uchar16;
- # typedef vector signed char __cl_char16;
- # typedef vector unsigned short __cl_ushort8;
- # typedef vector signed short __cl_short8;
- # typedef vector unsigned int __cl_uint4;
- # typedef vector signed int __cl_int4;
- # typedef vector float __cl_float4;
- #
+ CL_FLOAT4* = 1
+when defined(SSE2):
+ when defined(MINGW64):
+ nil
+ else:
+ when defined(GNUC):
+ #
+ # typedef cl_uchar __cl_uchar16 __attribute__((vector_size(16)));
+ # typedef cl_char __cl_char16 __attribute__((vector_size(16)));
+ # typedef cl_ushort __cl_ushort8 __attribute__((vector_size(16)));
+ # typedef cl_short __cl_short8 __attribute__((vector_size(16)));
+ # typedef cl_uint __cl_uint4 __attribute__((vector_size(16)));
+ # typedef cl_int __cl_int4 __attribute__((vector_size(16)));
+ # typedef cl_ulong __cl_ulong2 __attribute__((vector_size(16)));
+ # typedef cl_long __cl_long2 __attribute__((vector_size(16)));
+ # typedef cl_double __cl_double2 __attribute__((vector_size(16)));
+ #
+ else:
+ type
+ cl_uchar16* = m128i
+ cl_char16* = m128i
+ cl_ushort8* = m128i
+ cl_short8* = m128i
+ cl_uint4* = m128i
+ cl_int4* = m128i
+ cl_ulong2* = m128i
+ cl_long2* = m128i
+ cl_double2* = m128d
const
CL_UCHAR16* = 1
CL_CHAR16* = 1
CL_USHORT8* = 1
CL_SHORT8* = 1
- CL_UINT4* = 1
CL_INT4* = 1
- CL_FLOAT4* = 1
- when defined(SSE):
- when defined(MINGW64):
- nil
+ CL_UINT4* = 1
+ CL_ULONG2* = 1
+ CL_LONG2* = 1
+ CL_DOUBLE2* = 1
+ when defined(MMX):
+ when defined(GNUC):
+ #
+ # typedef cl_uchar __cl_uchar8 __attribute__((vector_size(8)));
+ # typedef cl_char __cl_char8 __attribute__((vector_size(8)));
+ # typedef cl_ushort __cl_ushort4 __attribute__((vector_size(8)));
+ # typedef cl_short __cl_short4 __attribute__((vector_size(8)));
+ # typedef cl_uint __cl_uint2 __attribute__((vector_size(8)));
+ # typedef cl_int __cl_int2 __attribute__((vector_size(8)));
+ # typedef cl_ulong __cl_ulong1 __attribute__((vector_size(8)));
+ # typedef cl_long __cl_long1 __attribute__((vector_size(8)));
+ # typedef cl_float __cl_float2 __attribute__((vector_size(8)));
+ #
else:
- when defined(GNUC):
- #typedef float __cl_float4 __attribute__((vector_size(16)));
- else:
- type
- cl_float4* = m128
- const
- CL_FLOAT4* = 1
- when defined(SSE2):
+ type
+ cl_uchar8* = m64
+ cl_char8* = m64
+ cl_ushort4* = m64
+ cl_short4* = m64
+ cl_uint2* = m64
+ cl_int2* = m64
+ cl_ulong1* = m64
+ cl_long1* = m64
+ cl_float2* = m64
+ const
+ CL_UCHAR8* = 1
+ CL_CHAR8* = 1
+ CL_USHORT4* = 1
+ CL_SHORT4* = 1
+ CL_INT2* = 1
+ CL_UINT2* = 1
+ CL_ULONG1* = 1
+ CL_LONG1* = 1
+ CL_FLOAT2* = 1
+ when defined(AVX):
when defined(MINGW64):
nil
else:
when defined(GNUC):
- #
- # typedef cl_uchar __cl_uchar16 __attribute__((vector_size(16)));
- # typedef cl_char __cl_char16 __attribute__((vector_size(16)));
- # typedef cl_ushort __cl_ushort8 __attribute__((vector_size(16)));
- # typedef cl_short __cl_short8 __attribute__((vector_size(16)));
- # typedef cl_uint __cl_uint4 __attribute__((vector_size(16)));
- # typedef cl_int __cl_int4 __attribute__((vector_size(16)));
- # typedef cl_ulong __cl_ulong2 __attribute__((vector_size(16)));
- # typedef cl_long __cl_long2 __attribute__((vector_size(16)));
- # typedef cl_double __cl_double2 __attribute__((vector_size(16)));
- #
+ #typedef cl_float __cl_float8 __attribute__((vector_size(32)));
+ #typedef cl_double __cl_double4 __attribute__((vector_size(32)));
else:
- type
- cl_uchar16* = m128i
- cl_char16* = m128i
- cl_ushort8* = m128i
- cl_short8* = m128i
- cl_uint4* = m128i
- cl_int4* = m128i
- cl_ulong2* = m128i
- cl_long2* = m128i
- cl_double2* = m128d
- const
- CL_UCHAR16* = 1
- CL_CHAR16* = 1
- CL_USHORT8* = 1
- CL_SHORT8* = 1
- CL_INT4* = 1
- CL_UINT4* = 1
- CL_ULONG2* = 1
- CL_LONG2* = 1
- CL_DOUBLE2* = 1
- when defined(MMX):
- when defined(GNUC):
#
- # typedef cl_uchar __cl_uchar8 __attribute__((vector_size(8)));
- # typedef cl_char __cl_char8 __attribute__((vector_size(8)));
- # typedef cl_ushort __cl_ushort4 __attribute__((vector_size(8)));
- # typedef cl_short __cl_short4 __attribute__((vector_size(8)));
- # typedef cl_uint __cl_uint2 __attribute__((vector_size(8)));
- # typedef cl_int __cl_int2 __attribute__((vector_size(8)));
- # typedef cl_ulong __cl_ulong1 __attribute__((vector_size(8)));
- # typedef cl_long __cl_long1 __attribute__((vector_size(8)));
- # typedef cl_float __cl_float2 __attribute__((vector_size(8)));
+ # typedef __m256 __cl_float8;
+ # typedef __m256d __cl_double4;
#
- else:
- type
- cl_uchar8* = m64
- cl_char8* = m64
- cl_ushort4* = m64
- cl_short4* = m64
- cl_uint2* = m64
- cl_int2* = m64
- cl_ulong1* = m64
- cl_long1* = m64
- cl_float2* = m64
const
- CL_UCHAR8* = 1
- CL_CHAR8* = 1
- CL_USHORT4* = 1
- CL_SHORT4* = 1
- CL_INT2* = 1
- CL_UINT2* = 1
- CL_ULONG1* = 1
- CL_LONG1* = 1
- CL_FLOAT2* = 1
- when defined(AVX):
- when defined(MINGW64):
- nil
- else:
- when defined(GNUC):
- #typedef cl_float __cl_float8 __attribute__((vector_size(32)));
- #typedef cl_double __cl_double4 __attribute__((vector_size(32)));
- else:
- #
- # typedef __m256 __cl_float8;
- # typedef __m256d __cl_double4;
- #
- const
- CL_FLOAT8* = 1
- CL_DOUBLE4* = 1
- # Define alignment keys
- when defined(GNUC):
- template CL_ALIGNED*(x: expr): expr =
- attribute((aligned(x)))
-
- elif defined(WIN32) and (MSC_VER):
- # Alignment keys neutered on windows because MSVC can't swallow function arguments with alignment requirements
- # http://msdn.microsoft.com/en-us/library/373ak2y1%28VS.71%29.aspx
- # #include <crtdefs.h>
- # #define CL_ALIGNED(_x) _CRT_ALIGN(_x)
- template CL_ALIGNED*(x: expr): stmt =
- nil
+ CL_FLOAT8* = 1
+ CL_DOUBLE4* = 1
+ # Define alignment keys
+ when defined(GNUC):
+ template CL_ALIGNED*(x: expr): expr =
+ attribute((aligned(x)))
- else:
- template CL_ALIGNED*(x: expr): stmt =
- nil
+ elif defined(WIN32) and (MSC_VER):
+ # Alignment keys neutered on windows because MSVC can't swallow function arguments with alignment requirements
+ # http://msdn.microsoft.com/en-us/library/373ak2y1%28VS.71%29.aspx
+ # #include <crtdefs.h>
+ # #define CL_ALIGNED(_x) _CRT_ALIGN(_x)
+ template CL_ALIGNED*(x: expr): stmt =
+ nil
- # Indicate whether .xyzw, .s0123 and .hi.lo are supported
- when defined(GNUC) and not defined(STRICT_ANSI):
- # .xyzw and .s0123...{f|F} are supported
- const
- CL_HAS_NAMED_VECTOR_FIELDS* = 1
- # .hi and .lo are supported
- const
- CL_HAS_HI_LO_VECTOR_FIELDS* = 1
- # Define cl_vector types
- # ---- cl_charn ----
- #
- #typedef union
- #{
- # //cl_char CL_ALIGNED(2) s[2];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_char x, y; };
- # __extension__ struct{ cl_char s0, s1; };
- # __extension__ struct{ cl_char lo, hi; };
- ##endif
- ##if defined( __CL_CHAR2__)
- # __cl_char2 v2;
- ##endif
- #}cl_char2;
- #
- #typedef union
- #{
- # cl_char CL_ALIGNED(4) s[4];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_char x, y, z, w; };
- # __extension__ struct{ cl_char s0, s1, s2, s3; };
- # __extension__ struct{ cl_char2 lo, hi; };
- ##endif
- ##if defined( __CL_CHAR2__)
- # __cl_char2 v2[2];
- ##endif
- ##if defined( __CL_CHAR4__)
- # __cl_char4 v4;
- ##endif
- #}cl_char4;
- #
- # cl_char3 is identical in size, alignment and behavior to cl_char4. See section 6.1.5.
- #type
- # cl_char3* = cl_char4
- #
- #typedef union
- #{
- # cl_char CL_ALIGNED(8) s[8];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_char x, y, z, w; };
- # __extension__ struct{ cl_char s0, s1, s2, s3, s4, s5, s6, s7; };
- # __extension__ struct{ cl_char4 lo, hi; };
- ##endif
- ##if defined( __CL_CHAR2__)
- # __cl_char2 v2[4];
- ##endif
- ##if defined( __CL_CHAR4__)
- # __cl_char4 v4[2];
- ##endif
- ##if defined( __CL_CHAR8__ )
- # __cl_char8 v8;
- ##endif
- #}cl_char8;
- #
- #typedef union
- #{
- # cl_char CL_ALIGNED(16) s[16];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_char x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
- # __extension__ struct{ cl_char s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
- # __extension__ struct{ cl_char8 lo, hi; };
- ##endif
- ##if defined( __CL_CHAR2__)
- # __cl_char2 v2[8];
- ##endif
- ##if defined( __CL_CHAR4__)
- # __cl_char4 v4[4];
- ##endif
- ##if defined( __CL_CHAR8__ )
- # __cl_char8 v8[2];
- ##endif
- ##if defined( __CL_CHAR16__ )
- # __cl_char16 v16;
- ##endif
- #}cl_char16;
- #
- # ---- cl_ucharn ----
- #
- #typedef union
- #{
- # cl_uchar CL_ALIGNED(2) s[2];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_uchar x, y; };
- # __extension__ struct{ cl_uchar s0, s1; };
- # __extension__ struct{ cl_uchar lo, hi; };
- ##endif
- ##if defined( __cl_uchar2__)
- # __cl_uchar2 v2;
- ##endif
- #}cl_uchar2;
- #
- #typedef union
- #{
- # cl_uchar CL_ALIGNED(4) s[4];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_uchar x, y, z, w; };
- # __extension__ struct{ cl_uchar s0, s1, s2, s3; };
- # __extension__ struct{ cl_uchar2 lo, hi; };
- ##endif
- ##if defined( __CL_UCHAR2__)
- # __cl_uchar2 v2[2];
- ##endif
- ##if defined( __CL_UCHAR4__)
- # __cl_uchar4 v4;
- ##endif
- #}cl_uchar4;
- #
- # cl_uchar3 is identical in size, alignment and behavior to cl_uchar4. See section 6.1.5.
- #
- #typedef cl_uchar4 cl_uchar3;
- #
- #typedef union
- #{
- # cl_uchar CL_ALIGNED(8) s[8];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_uchar x, y, z, w; };
- # __extension__ struct{ cl_uchar s0, s1, s2, s3, s4, s5, s6, s7; };
- # __extension__ struct{ cl_uchar4 lo, hi; };
- ##endif
- ##if defined( __CL_UCHAR2__)
- # __cl_uchar2 v2[4];
- ##endif
- ##if defined( __CL_UCHAR4__)
- # __cl_uchar4 v4[2];
- ##endif
- ##if defined( __CL_UCHAR8__ )
- # __cl_uchar8 v8;
- ##endif
- #}cl_uchar8;
- #
- #typedef union
- #{
- # cl_uchar CL_ALIGNED(16) s[16];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_uchar x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
- # __extension__ struct{ cl_uchar s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
- # __extension__ struct{ cl_uchar8 lo, hi; };
- ##endif
- ##if defined( __CL_UCHAR2__)
- # __cl_uchar2 v2[8];
- ##endif
- ##if defined( __CL_UCHAR4__)
- # __cl_uchar4 v4[4];
- ##endif
- ##if defined( __CL_UCHAR8__ )
- # __cl_uchar8 v8[2];
- ##endif
- ##if defined( __CL_UCHAR16__ )
- # __cl_uchar16 v16;
- ##endif
- #}cl_uchar16;
- #
- # ---- cl_shortn ----
- #
- #typedef union
- #{
- # cl_short CL_ALIGNED(4) s[2];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_short x, y; };
- # __extension__ struct{ cl_short s0, s1; };
- # __extension__ struct{ cl_short lo, hi; };
- ##endif
- ##if defined( __CL_SHORT2__)
- # __cl_short2 v2;
- ##endif
- #}cl_short2;
- #
- #typedef union
- #{
- # cl_short CL_ALIGNED(8) s[4];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_short x, y, z, w; };
- # __extension__ struct{ cl_short s0, s1, s2, s3; };
- # __extension__ struct{ cl_short2 lo, hi; };
- ##endif
- ##if defined( __CL_SHORT2__)
- # __cl_short2 v2[2];
- ##endif
- ##if defined( __CL_SHORT4__)
- # __cl_short4 v4;
- ##endif
- #}cl_short4;
- #
- # cl_short3 is identical in size, alignment and behavior to cl_short4. See section 6.1.5.
- #
- #typedef cl_short4 cl_short3;
- #
- #typedef union
- #{
- # cl_short CL_ALIGNED(16) s[8];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_short x, y, z, w; };
- # __extension__ struct{ cl_short s0, s1, s2, s3, s4, s5, s6, s7; };
- # __extension__ struct{ cl_short4 lo, hi; };
- ##endif
- ##if defined( __CL_SHORT2__)
- # __cl_short2 v2[4];
- ##endif
- ##if defined( __CL_SHORT4__)
- # __cl_short4 v4[2];
- ##endif
- ##if defined( __CL_SHORT8__ )
- # __cl_short8 v8;
- ##endif
- #}cl_short8;
- #
- #typedef union
- #{
- # cl_short CL_ALIGNED(32) s[16];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_short x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
- # __extension__ struct{ cl_short s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
- # __extension__ struct{ cl_short8 lo, hi; };
- ##endif
- ##if defined( __CL_SHORT2__)
- # __cl_short2 v2[8];
- ##endif
- ##if defined( __CL_SHORT4__)
- # __cl_short4 v4[4];
- ##endif
- ##if defined( __CL_SHORT8__ )
- # __cl_short8 v8[2];
- ##endif
- ##if defined( __CL_SHORT16__ )
- # __cl_short16 v16;
- ##endif
- #}cl_short16;
- #
- # ---- cl_ushortn ----
- #
- #typedef union
- #{
- # cl_ushort CL_ALIGNED(4) s[2];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_ushort x, y; };
- # __extension__ struct{ cl_ushort s0, s1; };
- # __extension__ struct{ cl_ushort lo, hi; };
- ##endif
- ##if defined( __CL_USHORT2__)
- # __cl_ushort2 v2;
- ##endif
- #}cl_ushort2;
- #
- #typedef union
- #{
- # cl_ushort CL_ALIGNED(8) s[4];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_ushort x, y, z, w; };
- # __extension__ struct{ cl_ushort s0, s1, s2, s3; };
- # __extension__ struct{ cl_ushort2 lo, hi; };
- ##endif
- ##if defined( __CL_USHORT2__)
- # __cl_ushort2 v2[2];
- ##endif
- ##if defined( __CL_USHORT4__)
- # __cl_ushort4 v4;
- ##endif
- #}cl_ushort4;
- #
- # cl_ushort3 is identical in size, alignment and behavior to cl_ushort4. See section 6.1.5.
- #
- #typedef cl_ushort4 cl_ushort3;
- #
- #typedef union
- #{
- # cl_ushort CL_ALIGNED(16) s[8];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_ushort x, y, z, w; };
- # __extension__ struct{ cl_ushort s0, s1, s2, s3, s4, s5, s6, s7; };
- # __extension__ struct{ cl_ushort4 lo, hi; };
- ##endif
- ##if defined( __CL_USHORT2__)
- # __cl_ushort2 v2[4];
- ##endif
- ##if defined( __CL_USHORT4__)
- # __cl_ushort4 v4[2];
- ##endif
- ##if defined( __CL_USHORT8__ )
- # __cl_ushort8 v8;
- ##endif
- #}cl_ushort8;
- #
- #typedef union
- #{
- # cl_ushort CL_ALIGNED(32) s[16];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_ushort x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
- # __extension__ struct{ cl_ushort s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
- # __extension__ struct{ cl_ushort8 lo, hi; };
- ##endif
- ##if defined( __CL_USHORT2__)
- # __cl_ushort2 v2[8];
- ##endif
- ##if defined( __CL_USHORT4__)
- # __cl_ushort4 v4[4];
- ##endif
- ##if defined( __CL_USHORT8__ )
- # __cl_ushort8 v8[2];
- ##endif
- ##if defined( __CL_USHORT16__ )
- # __cl_ushort16 v16;
- ##endif
- #}cl_ushort16;
- #
- # ---- cl_intn ----
- #
- #typedef union
- #{
- # cl_int CL_ALIGNED(8) s[2];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_int x, y; };
- # __extension__ struct{ cl_int s0, s1; };
- # __extension__ struct{ cl_int lo, hi; };
- ##endif
- ##if defined( __CL_INT2__)
- # __cl_int2 v2;
- ##endif
- #}cl_int2;
- #
- #typedef union
- #{
- # cl_int CL_ALIGNED(16) s[4];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_int x, y, z, w; };
- # __extension__ struct{ cl_int s0, s1, s2, s3; };
- # __extension__ struct{ cl_int2 lo, hi; };
- ##endif
- ##if defined( __CL_INT2__)
- # __cl_int2 v2[2];
- ##endif
- ##if defined( __CL_INT4__)
- # __cl_int4 v4;
- ##endif
- #}cl_int4;
- #
- # cl_int3 is identical in size, alignment and behavior to cl_int4. See section 6.1.5.
- #
- #typedef cl_int4 cl_int3;
- #
- #typedef union
- #{
- # cl_int CL_ALIGNED(32) s[8];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_int x, y, z, w; };
- # __extension__ struct{ cl_int s0, s1, s2, s3, s4, s5, s6, s7; };
- # __extension__ struct{ cl_int4 lo, hi; };
- ##endif
- ##if defined( __CL_INT2__)
- # __cl_int2 v2[4];
- ##endif
- ##if defined( __CL_INT4__)
- # __cl_int4 v4[2];
- ##endif
- ##if defined( __CL_INT8__ )
- # __cl_int8 v8;
- ##endif
- #}cl_int8;
- #
- #typedef union
- #{
- # cl_int CL_ALIGNED(64) s[16];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_int x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
- # __extension__ struct{ cl_int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
- # __extension__ struct{ cl_int8 lo, hi; };
- ##endif
- ##if defined( __CL_INT2__)
- # __cl_int2 v2[8];
- ##endif
- ##if defined( __CL_INT4__)
- # __cl_int4 v4[4];
- ##endif
- ##if defined( __CL_INT8__ )
- # __cl_int8 v8[2];
- ##endif
- ##if defined( __CL_INT16__ )
- # __cl_int16 v16;
- ##endif
- #}cl_int16;
- #
- # ---- cl_uintn ----
- #
- #typedef union
- #{
- # cl_uint CL_ALIGNED(8) s[2];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_uint x, y; };
- # __extension__ struct{ cl_uint s0, s1; };
- # __extension__ struct{ cl_uint lo, hi; };
- ##endif
- ##if defined( __CL_UINT2__)
- # __cl_uint2 v2;
- ##endif
- #}cl_uint2;
- #
- #typedef union
- #{
- # cl_uint CL_ALIGNED(16) s[4];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_uint x, y, z, w; };
- # __extension__ struct{ cl_uint s0, s1, s2, s3; };
- # __extension__ struct{ cl_uint2 lo, hi; };
- ##endif
- ##if defined( __CL_UINT2__)
- # __cl_uint2 v2[2];
- ##endif
- ##if defined( __CL_UINT4__)
- # __cl_uint4 v4;
- ##endif
- #}cl_uint4;
- #
- # cl_uint3 is identical in size, alignment and behavior to cl_uint4. See section 6.1.5.
- #
- #typedef cl_uint4 cl_uint3;
- #
- #typedef union
- #{
- # cl_uint CL_ALIGNED(32) s[8];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_uint x, y, z, w; };
- # __extension__ struct{ cl_uint s0, s1, s2, s3, s4, s5, s6, s7; };
- # __extension__ struct{ cl_uint4 lo, hi; };
- ##endif
- ##if defined( __CL_UINT2__)
- # __cl_uint2 v2[4];
- ##endif
- ##if defined( __CL_UINT4__)
- # __cl_uint4 v4[2];
- ##endif
- ##if defined( __CL_UINT8__ )
- # __cl_uint8 v8;
- ##endif
- #}cl_uint8;
- #
- #typedef union
- #{
- # cl_uint CL_ALIGNED(64) s[16];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_uint x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
- # __extension__ struct{ cl_uint s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
- # __extension__ struct{ cl_uint8 lo, hi; };
- ##endif
- ##if defined( __CL_UINT2__)
- # __cl_uint2 v2[8];
- ##endif
- ##if defined( __CL_UINT4__)
- # __cl_uint4 v4[4];
- ##endif
- ##if defined( __CL_UINT8__ )
- # __cl_uint8 v8[2];
- ##endif
- ##if defined( __CL_UINT16__ )
- # __cl_uint16 v16;
- ##endif
- #}cl_uint16;
- #
- # ---- cl_longn ----
- #
- #typedef union
- #{
- # cl_long CL_ALIGNED(16) s[2];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_long x, y; };
- # __extension__ struct{ cl_long s0, s1; };
- # __extension__ struct{ cl_long lo, hi; };
- ##endif
- ##if defined( __CL_LONG2__)
- # __cl_long2 v2;
- ##endif
- #}cl_long2;
- #
- #typedef union
- #{
- # cl_long CL_ALIGNED(32) s[4];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
- # __extension__ struct{ cl_long x, y, z, w; };
- # __extension__ struct{ cl_long s0, s1, s2, s3; };
- # __extension__ struct{ cl_long2 lo, hi; };
- ##endif
- ##if defined( __CL_LONG2__)
- # __cl_long2 v2[2];
- ##endif
- ##if defined( __CL_LONG4__)
- # __cl_long4 v4;
- ##endif
- #}cl_long4;
- #
- # cl_long3 is identical in size, alignment and behavior to cl_long4. See section 6.1.5.
- #
- #typedef cl_long4 cl_long3;
- #
- #typedef union
- #{
- # cl_long CL_ALIGNED(64) s[8];
- ##if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
-