xref: /aosp_15_r20/external/OpenCL-CTS/test_conformance/mem_host_flags/main.cpp (revision 6467f958c7de8070b317fc65bcb0f6472e388d82)
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 #include "harness/compat.h"
17 
18 #include <stdio.h>
19 #include <string.h>
20 
21 #if !defined(__APPLE__)
22 #include <CL/cl.h>
23 #endif
24 
25 #include "procs.h"
26 #include "harness/testHarness.h"
27 
28 #if !defined(_WIN32)
29 #include <unistd.h>
30 #endif
31 
32 test_definition test_list[] = {
33     ADD_TEST(mem_host_read_only_buffer),
34     ADD_TEST(mem_host_read_only_subbuffer),
35     ADD_TEST(mem_host_write_only_buffer),
36     ADD_TEST(mem_host_write_only_subbuffer),
37     ADD_TEST(mem_host_no_access_buffer),
38     ADD_TEST(mem_host_no_access_subbuffer),
39     ADD_TEST(mem_host_read_only_image),
40     ADD_TEST(mem_host_write_only_image),
41     ADD_TEST(mem_host_no_access_image),
42 };
43 
44 const int test_num = ARRAY_SIZE(test_list);
45 
main(int argc,const char * argv[])46 int main(int argc, const char *argv[])
47 {
48     log_info("1st part, non gl-sharing objects...\n");
49     gTestRounding = true;
50     return runTestHarness(argc, argv, test_num, test_list, false, 0);
51 }
52