make execution of workgroups test optional (#643)

This commit is contained in:
Kévin Petit
2020-03-05 08:22:36 +00:00
committed by GitHub
parent 58eb2373a8
commit c9c3c73aa9
2 changed files with 47 additions and 21 deletions

View File

@@ -23,6 +23,10 @@ add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_2_APIS=1)
add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_1_APIS=1) add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_1_APIS=1)
add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_0_APIS=1) add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_0_APIS=1)
option(USE_CL_EXPERIMENTAL "Use Experimental definitions" OFF)
if(USE_CL_EXPERIMENTAL)
add_definitions(-DCL_EXPERIMENTAL)
endif(USE_CL_EXPERIMENTAL)
# Support both VS2008 and VS2012. # Support both VS2008 and VS2012.
set(BUILD_DIR "$ENV{ADRENO_DRIVER}/build") set(BUILD_DIR "$ENV{ADRENO_DRIVER}/build")

View File

@@ -1,6 +1,6 @@
// //
// Copyright (c) 2017 The Khronos Group Inc. // Copyright (c) 2017 The Khronos Group Inc.
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
// You may obtain a copy of the License at // You may obtain a copy of the License at
@@ -15,35 +15,57 @@
// //
#include "harness/compat.h" #include "harness/compat.h"
#include "harness/testHarness.h"
#include "procs.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "procs.h"
#include "harness/testHarness.h"
#if !defined(_WIN32) #if !defined(_WIN32)
#include <unistd.h> #include <unistd.h>
#endif #endif
test_definition test_list[] = { test_definition test_list[] = {
ADD_TEST( work_group_all ), ADD_TEST(work_group_all),
ADD_TEST( work_group_any ), ADD_TEST(work_group_any),
ADD_TEST( work_group_reduce_add ), ADD_TEST(work_group_reduce_add),
ADD_TEST( work_group_reduce_min ), ADD_TEST(work_group_reduce_min),
ADD_TEST( work_group_reduce_max ), ADD_TEST(work_group_reduce_max),
ADD_TEST( work_group_scan_inclusive_add ), ADD_TEST(work_group_scan_inclusive_add),
ADD_TEST( work_group_scan_inclusive_min ), ADD_TEST(work_group_scan_inclusive_min),
ADD_TEST( work_group_scan_inclusive_max ), ADD_TEST(work_group_scan_inclusive_max),
ADD_TEST( work_group_scan_exclusive_add ), ADD_TEST(work_group_scan_exclusive_add),
ADD_TEST( work_group_scan_exclusive_min ), ADD_TEST(work_group_scan_exclusive_min),
ADD_TEST( work_group_scan_exclusive_max ), ADD_TEST(work_group_scan_exclusive_max),
ADD_TEST( work_group_broadcast_1D ), ADD_TEST(work_group_broadcast_1D),
ADD_TEST( work_group_broadcast_2D ), ADD_TEST(work_group_broadcast_2D),
ADD_TEST( work_group_broadcast_3D ), ADD_TEST(work_group_broadcast_3D),
}; };
const int test_num = ARRAY_SIZE( test_list ); const int test_num = ARRAY_SIZE(test_list);
int main(int argc, const char *argv[]) test_status InitCL(cl_device_id device) {
{ #ifdef CL_EXPERIMENTAL
return runTestHarness( argc, argv, test_num, test_list, false, false, 0 ); auto version = get_device_cl_version(device);
if(version > Version(2,2)) {
int error;
cl_bool isSupported;
error = clGetDeviceInfo(device,
CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT,
sizeof(isSupported), &isSupported, NULL);
if (error != CL_SUCCESS) {
print_error(error, "Unable to query support for collective functions");
return TEST_FAIL;
}
if (isSupported == CL_FALSE) {
return TEST_SKIP;
}
}
#endif
return TEST_PASS;
}
int main(int argc, const char *argv[]) {
return runTestHarnessWithCheck(argc, argv, test_num, test_list, false, 0, InitCL);
} }