1 // 2 // Copyright (c) 2017 The Khronos Group Inc. 3 // 4 // Licensed under the Apache License, Version 2.0 (the "License"); 5 // you may not use this file except in compliance with the License. 6 // You may obtain a copy of the License at 7 // 8 // http://www.apache.org/licenses/LICENSE-2.0 9 // 10 // Unless required by applicable law or agreed to in writing, software 11 // distributed under the License is distributed on an "AS IS" BASIS, 12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 // See the License for the specific language governing permissions and 14 // limitations under the License. 15 // 16 #ifndef TESTS_H 17 #define TESTS_H 18 19 #include <CL/cl.h> 20 21 typedef enum 22 { 23 AS_Global, 24 AS_Private, 25 AS_Local, 26 AS_Constant, 27 AS_NumAddressSpaces 28 } AddressSpaceEnum; 29 30 extern const char *addressSpaceNames[AS_NumAddressSpaces]; 31 32 33 int test_vload_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); 34 int test_vloada_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); 35 int test_vstore_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); 36 int test_vstorea_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); 37 int test_vstore_half_rte( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); 38 int test_vstorea_half_rte( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); 39 int test_vstore_half_rtz( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); 40 int test_vstorea_half_rtz( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); 41 int test_vstore_half_rtp( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); 42 int test_vstorea_half_rtp( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); 43 int test_vstore_half_rtn( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); 44 int test_vstorea_half_rtn( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); 45 int test_roundTrip( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements ); 46 47 typedef cl_ushort (*f2h)( float ); 48 typedef cl_ushort (*d2h)( double ); 49 int Test_vStoreHalf_private( cl_device_id device, f2h referenceFunc, d2h referenceDoubleFunc, const char *roundName ); 50 int Test_vStoreaHalf_private( cl_device_id device, f2h referenceFunc, d2h referenceDoubleFunc, const char *roundName ); 51 52 #endif /* TESTS_H */ 53 54 55