From f7d2dab69657e1a204bf814ccbdb3ea8ca4af933 Mon Sep 17 00:00:00 2001 From: Denis Steckelmacher Date: Sun, 7 Aug 2011 18:41:54 +0200 Subject: Test infrastructure for built-in functions, test Samplers. --- src/api/api_event.cpp | 3 +++ src/core/commandqueue.cpp | 5 ++++- src/core/commandqueue.h | 1 + src/core/sampler.cpp | 2 +- src/core/sampler.h | 2 ++ src/runtime/stdlib.h | 15 +++++++++++++-- 6 files changed, 24 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/api/api_event.cpp b/src/api/api_event.cpp index 029506c..14f6ac0 100644 --- a/src/api/api_event.cpp +++ b/src/api/api_event.cpp @@ -91,7 +91,10 @@ clReleaseEvent(cl_event event) return CL_INVALID_EVENT; if (event->dereference()) + { + event->freeDeviceData(); delete event; + } return CL_SUCCESS; } diff --git a/src/core/commandqueue.cpp b/src/core/commandqueue.cpp index 32858a5..9e6aeca 100644 --- a/src/core/commandqueue.cpp +++ b/src/core/commandqueue.cpp @@ -403,7 +403,7 @@ Event::Event(CommandQueue *parent, } } -Event::~Event() +void Event::freeDeviceData() { if (parent() && p_device_data) { @@ -412,7 +412,10 @@ Event::~Event() device->freeEventDeviceData(this); } +} +Event::~Event() +{ for (int i=0; i #include "object.h" +// WARNING: Keep in sync with stdlib.h + #define CLK_NORMALIZED_COORDS_FALSE 0x00000000 #define CLK_NORMALIZED_COORDS_TRUE 0x00000001 #define CLK_ADDRESS_NONE 0x00000000 diff --git a/src/runtime/stdlib.h b/src/runtime/stdlib.h index f1c7749..dae9043 100644 --- a/src/runtime/stdlib.h +++ b/src/runtime/stdlib.h @@ -7,13 +7,13 @@ typedef unsigned long ulong; typedef int *intptr_t; typedef uint *uintptr_t; +typedef unsigned int sampler_t; + /* Standard types from Clang's stddef, Copyright (C) 2008 Eli Friedman */ typedef __typeof__(((int*)0)-((int*)0)) ptrdiff_t; typedef __typeof__(sizeof(int)) size_t; /* Vectors */ - -//typedef float float4 __attribute__((ext_vector_type(4))); #define COAL_VECTOR(type, len) \ typedef type type##len __attribute__((ext_vector_type(len))) #define COAL_VECTOR_SET(type) \ @@ -55,6 +55,17 @@ COAL_VECTOR_SET(float); #define write_only __write_only #define read_only __read_only +/* Defines */ +#define CLK_NORMALIZED_COORDS_FALSE 0x00000000 +#define CLK_NORMALIZED_COORDS_TRUE 0x00000001 +#define CLK_ADDRESS_NONE 0x00000000 +#define CLK_ADDRESS_MIRRORED_REPEAT 0x00000010 +#define CLK_ADDRESS_REPEAT 0x00000020 +#define CLK_ADDRESS_CLAMP_TO_EDGE 0x00000030 +#define CLK_ADDRESS_CLAMP 0x00000040 +#define CLK_FILTER_NEAREST 0x00000000 +#define CLK_FILTER_LINEAR 0x00000100 + /* Management functions */ uint get_work_dim(); size_t get_global_size(uint dimindx); -- cgit v1.2.3