// write result for this block to global mem
if(tid == 0) output[bid] = callA[0];
-}
\ No newline at end of file
+}
temp1 = convert_float4(temp[i]) * one / intMax;
temp2 = convert_float4(temp[i + 1]) * one / intMax;
- // Applying Box Mullar Transformations.
+ // Asinf Box Mullar Transformations.
r = sqrt((-two) * log(temp1));
phi = two * PI * temp2;
gaussianRand[actualPos + i * 2 + 0] = r * cos(phi);
--- /dev/null
+__kernel void
+test_trigo(__global float *dst, __global const float *src)
+{
+ const int offset = get_global_id(0);
+ dst[offset] = sin(src[offset]);
+}
+
ADD_EXECUTABLE(test_constant_memory tests/test_constant_memory.c)
ADD_EXECUTABLE(test_memory_leak tests/test_memory_leak.c)
ADD_EXECUTABLE(test_perf_report tests/test_perf_report.c)
+ADD_EXECUTABLE(test_trigo tests/test_trigo.c)
ADD_EXECUTABLE(mersenneTwister tests/mersenneTwister.c)
ADD_EXECUTABLE(blackscholes tests/blackscholes.c)
ADD_EXECUTABLE(matmul tests/matmul.c)
TARGET_LINK_LIBRARIES(test_constant_memory cl_test m)
TARGET_LINK_LIBRARIES(test_memory_leak cl_test m)
TARGET_LINK_LIBRARIES(test_perf_report cl_test m)
+TARGET_LINK_LIBRARIES(test_trigo cl_test m)
TARGET_LINK_LIBRARIES(mersenneTwister cl_test m)
TARGET_LINK_LIBRARIES(blackscholes cl_test m)
TARGET_LINK_LIBRARIES(matmul cl_test m)
atomic_inc(&queue->ref_n);
}
-#define SURFACE_SZ 32
-
LOCAL cl_int
cl_command_queue_bind_surface(cl_command_queue queue,
cl_kernel k,
const size_t sz = init->sz;
cl_int err = CL_SUCCESS;
- FATAL_IF (init->offset % 64, "Bad alignment for inline buffer offset");
+ FATAL_IF (init->offset % SURFACE_SZ, "Bad alignment for inline buffer offset");
FATAL_IF (k->const_bo != NULL, "inline buffer already declared");
assert(k->program && k->program->ctx);
bufmgr = cl_context_get_intel_bufmgr(k->program->ctx);
sz,
64));
drm_intel_bo_subdata(k->const_bo, 0, sz, &init->data);
- k->const_bo_index = init->offset / 64;
+ k->const_bo_index = init->offset / SURFACE_SZ;
*read += sz;
*patch += sz;
uint8_t ref_its_program; /* True only for the user kernel (those created by clCreateKernel) */
};
+/* Size of the surface state as encoded in the binary blob */
+#define SURFACE_SZ 32
+
/* Allocate an empty kernel */
extern cl_kernel cl_kernel_new(void);
for (i = 0; i < ker_n; i++) {
memset(desc, 0, sizeof(*desc));
desc->desc0.kernel_start_pointer = kernel[i].bo->offset >> 6; /* reloc */
+ desc->desc1.floating_point_mode = 1;
/* desc->desc1 = 0; - no exception control, no SPF */
/* desc->desc2 = 0; - no samplers */
desc->desc2.sampler_state_pointer = state->sampler_state_b.bo->offset >> 5;