mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Merge branch 'cl21_trunk'
# Conflicts: # .travis.yml # CMakeLists.txt # CMakeVendor.txt # README.md # build_android.py # build_lnx.sh # build_win.bat # readme-spir-v-binaries.txt # test_common/harness/kernelHelpers.c # test_common/harness/kernelHelpers.h # test_conformance/CMakeLists.txt # test_conformance/opencl_conformance_tests_21_full_spirv.csv # test_conformance/opencl_conformance_tests_21_legacy_wimpy.csv # test_conformance/opencl_conformance_tests_full.csv # test_conformance/opencl_conformance_tests_full_no_math_or_conversions.csv # test_conformance/opencl_conformance_tests_quick.csv # test_conformance/run_conformance.py
This commit is contained in:
@@ -108,7 +108,9 @@ def install_android_cmake():
|
||||
print "input: "
|
||||
if get_input():
|
||||
print("installing android-cmake")
|
||||
subprocess.call(['git', 'clone', 'https://github.com/taka-no-me/android-cmake'])
|
||||
#subprocess.call(['git', 'clone', 'https://github.com/taka-no-me/android-cmake'])
|
||||
# Use a newer fork of android-cmake which has been updated to support Clang. GCC is deprecated in newer NDKs and C11 atomics conformance doesn't build with NDK > 10.
|
||||
subprocess.call(['git', 'clone', 'https://github.com/daewoong-jang/android-cmake'])
|
||||
args.android_cmake = os.path.join(args.src_dir,"android-cmake")
|
||||
else:
|
||||
exit()
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
To run the 2.2 conformance tests test suite for the C++ features you need
|
||||
SPIR-V binaries.
|
||||
To run the conformance tests you need SPIR-V binaries.
|
||||
|
||||
If you are using a conformance package then the binaries are included in the
|
||||
If you are using a conformance package then the binaries are included in the
|
||||
package. If you are using conformance tests from gitlab repositories then the
|
||||
binaries need to be picked up from Khronos SVN URL mentioned below:
|
||||
|
||||
@@ -39,4 +38,4 @@ Branch: opencl22
|
||||
5. OpenCL ICD (with 2.2 support)
|
||||
OpenCL ICD
|
||||
Repository: https://gitlab.khronos.org/opencl/icd
|
||||
Branch: dev_cl22
|
||||
Branch: dev_cl22
|
||||
|
||||
@@ -163,6 +163,13 @@ cl_device_fp_config get_default_rounding_mode( cl_device_id device );
|
||||
return 0; \
|
||||
}
|
||||
|
||||
#define PASSIVE_REQUIRE_FP16_SUPPORT(device) \
|
||||
if (!is_extension_available(device, "cl_khr_fp16")) \
|
||||
{ \
|
||||
log_info("\n\tNote: device does not support fp16. Skipping test...\n"); \
|
||||
return 0; \
|
||||
}
|
||||
|
||||
/* Prints out the standard device header for all tests given the device to print for */
|
||||
extern int printDeviceHeader( cl_device_id device );
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ add_subdirectory( workgroups )
|
||||
add_subdirectory( pipes )
|
||||
add_subdirectory( device_timer )
|
||||
add_subdirectory( clcpp )
|
||||
add_subdirectory( spirv_new )
|
||||
add_subdirectory( spir )
|
||||
|
||||
set(CSV_FILES
|
||||
@@ -90,4 +91,4 @@ foreach(FILE ${PY_FILES})
|
||||
endforeach()
|
||||
foreach(FILE test_conformance/${PY_FILES})
|
||||
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
7
test_conformance/build_script_binary.py
Normal file
7
test_conformance/build_script_binary.py
Normal file
@@ -0,0 +1,7 @@
|
||||
# Script parameters:
|
||||
# 1 - input file
|
||||
# 2 - output file
|
||||
# 3 - architecture: 32 or 64
|
||||
# 4 - one of the strings: binary, source, spir_v
|
||||
# 5 - OpenCL version: 12, 20
|
||||
# 6 - build options
|
||||
43
test_conformance/build_script_spirv.py
Normal file
43
test_conformance/build_script_spirv.py
Normal file
@@ -0,0 +1,43 @@
|
||||
# Script parameters:
|
||||
# 1 - input file
|
||||
# 2 - output file
|
||||
# 3 - architecture: 32 or 64
|
||||
# 4 - one of the strings: binary, source, spir_v
|
||||
# 5 - OpenCL version: 12, 20
|
||||
# 6 - build options
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
if len(sys.argv)<5:
|
||||
print 'Usage: "build_script_spirv.py <input> <output> <arch> <output_type> <opencl_version> [build_options]"'
|
||||
exit(1)
|
||||
|
||||
input_file = sys.argv[1]
|
||||
output_file = sys.argv[2]
|
||||
arch = sys.argv[3]
|
||||
output_type = sys.argv[4]
|
||||
ocl_version = sys.argv[5]
|
||||
build_options = ''
|
||||
|
||||
if len(sys.argv) == 5:
|
||||
build_options = sys.argv[6]
|
||||
|
||||
if arch == '32':
|
||||
arch_string = ''
|
||||
spir_arch = '__i386__'
|
||||
else:
|
||||
arch_string = '64'
|
||||
spir_arch = '__x86_64__'
|
||||
|
||||
if ocl_version == '20':
|
||||
oclc_version = '200'
|
||||
spir_version = '2.0'
|
||||
else:
|
||||
oclc_version = '120'
|
||||
spir_version = '1.2'
|
||||
|
||||
command = '%LLVMPATH%\\bin\\clang.exe -cc1 -include headers\\opencl_SPIR-' + spir_version + '.h -cl-std=CL' + spir_version +' -D__OPENCL_C_VERSION__=' + oclc_version + ' -fno-validate-pch -D__OPENCL_VERSION__=' + oclc_version + ' -x cl -cl-kernel-arg-info -O0 -emit-llvm-bc -triple spir' + arch_string + '-unknown-unknown -D' + spir_arch + ' -Dcl_khr_3d_image_writes -Dcl_khr_byte_addressable_store -Dcl_khr_d3d10_sharing -Dcl_khr_d3d11_sharing -Dcl_khr_depth_images -Dcl_khr_dx9_media_sharing -Dcl_khr_fp64 -Dcl_khr_global_int32_base_atomics -Dcl_khr_global_int32_extended_atomics -Dcl_khr_gl_depth_images -Dcl_khr_gl_event -Dcl_khr_gl_msaa_sharing -Dcl_khr_gl_sharing -Dcl_khr_icd -Dcl_khr_image2d_from_buffer -Dcl_khr_local_int32_base_atomics -Dcl_khr_local_int32_extended_atomics -Dcl_khr_mipmap_image -Dcl_khr_mipmap_image_writes -Dcl_khr_fp16 ' + build_options + ' -Dcl_khr_spir ' + input_file + ' -o intermediate.spir'
|
||||
os.system(command)
|
||||
command = '%LLVMPATH%\\bin\\llvm-spirv.exe intermediate.spir -o ' + output_file
|
||||
os.system(command)
|
||||
53
test_conformance/generate_spirv_offline.py
Normal file
53
test_conformance/generate_spirv_offline.py
Normal file
@@ -0,0 +1,53 @@
|
||||
import sys
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
import string
|
||||
import shutil
|
||||
import traceback
|
||||
|
||||
if len(sys.argv)<2:
|
||||
print 'Usage: "generate_spirv_offline.py <input> <32|64>"'
|
||||
exit(1)
|
||||
|
||||
input_dir = sys.argv[1]
|
||||
arch = sys.argv[2]
|
||||
|
||||
def generate_spirv():
|
||||
print "generating spirv"
|
||||
ocl_version = '12';
|
||||
build_options = ''
|
||||
|
||||
if os.path.exists(input_dir):
|
||||
for root, dirs, files in os.walk(input_dir):
|
||||
for file in files:
|
||||
if file.endswith('.cl'):
|
||||
options_file_name = file[:-2] + "options"
|
||||
ocl_version = '12'
|
||||
if os.path.exists(os.path.join(root, options_file_name)):
|
||||
optFile = open (os.path.join(root, options_file_name), 'rU')
|
||||
for line in optFile:
|
||||
if re.search("-cl-std=CL2.0", line):
|
||||
ocl_version = '20'
|
||||
build_options = re.sub("-cl-std=CL2.0", "", line)
|
||||
print build_options
|
||||
input_string = os.path.join(root, file)
|
||||
output_string = os.path.join(root, file[:-2])
|
||||
|
||||
command_line = ".\\build_script_spirv.py " + input_string + " " + output_string + "spv" + arch + " " + arch + " spir_v " + ocl_version + " \"" + build_options + " \""
|
||||
print command_line
|
||||
os.system(command_line)
|
||||
return 0
|
||||
|
||||
def main():
|
||||
try:
|
||||
generate_spirv()
|
||||
except Exception:
|
||||
traceback.print_exc(file=sys.stdout)
|
||||
sys.exit(0)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
|
||||
|
||||
@@ -111,6 +111,7 @@ Workgroups,workgroups/test_workgroups -offlineCompiler spir_v cache .
|
||||
# OpenCL 2.1 tests
|
||||
#####################################
|
||||
Device timer,device_timer/test_device_timer
|
||||
SPIRV new,spirv_new/test_spirv_new -ILPath spirv_bin
|
||||
|
||||
#########################################
|
||||
# Extensions
|
||||
|
||||
|
@@ -106,4 +106,4 @@ SPIR,spir/test_spir
|
||||
Mipmaps (Kernel),images/kernel_read_write/test_image_streams test_mipmaps CL_FILTER_NEAREST
|
||||
Mipmaps (clCopyImage),images/clCopyImage/test_cl_copy_images test_mipmaps
|
||||
Mipmaps (clReadWriteImage),images/clReadWriteImage/test_cl_read_write_images test_mipmaps
|
||||
Subgroups,subgroups/test_subgroups
|
||||
Subgroups,subgroups/test_subgroups
|
||||
|
||||
|
@@ -107,6 +107,12 @@ Pipes,pipes/test_pipes
|
||||
SVM,SVM/test_SVM
|
||||
Workgroups,workgroups/test_workgroups
|
||||
|
||||
#####################################
|
||||
# OpenCL 2.1 tests
|
||||
#####################################
|
||||
Device timer,device_timer/test_device_timer
|
||||
SPIRV new,spirv_new/test_spirv_new -ILPath spirv_bin
|
||||
|
||||
#########################################
|
||||
# Extensions
|
||||
#########################################
|
||||
@@ -114,4 +120,4 @@ SPIR,spir/test_spir
|
||||
Mipmaps (Kernel),images/kernel_read_write/test_image_streams test_mipmaps CL_FILTER_NEAREST
|
||||
Mipmaps (clCopyImage),images/clCopyImage/test_cl_copy_images test_mipmaps
|
||||
Mipmaps (clReadWriteImage),images/clReadWriteImage/test_cl_read_write_images test_mipmaps
|
||||
Subgroups,subgroups/test_subgroups
|
||||
Subgroups,subgroups/test_subgroups
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# OpenCL Conformance Test Suite (full version)
|
||||
# OpenCL Conformance Test Suite (no math and no conversion)
|
||||
#
|
||||
|
||||
# #########################################
|
||||
@@ -33,6 +33,8 @@ Allocations (single maximum),allocations/test_allocations single 5 all
|
||||
Allocations (total maximum),allocations/test_allocations multiple 5 all
|
||||
VecAlign, vec_align/test_vecalign
|
||||
VecStep, vec_step/test_vecstep
|
||||
Printf,printf/test_printf
|
||||
Device Partitioning,device_partition/test_device_partition
|
||||
|
||||
# #########################################
|
||||
# Buffers and images
|
||||
@@ -88,5 +90,36 @@ OpenCL-GL Sharing,gl/test_gl
|
||||
Select,select/test_select
|
||||
Contractions,contractions/contractions
|
||||
Integer Ops,integer_ops/test_integer_ops
|
||||
Half Ops,half/Test_half
|
||||
Half Ops,half/test_half
|
||||
|
||||
# #########################################
|
||||
# Compatibility with Previous Versions
|
||||
# #########################################
|
||||
Basic 1.2,compatibility/test_conformance/basic/test_basic
|
||||
API 1.2,compatibility/test_conformance/api/test_api
|
||||
|
||||
#####################################
|
||||
# OpenCL 2.0 tests
|
||||
#####################################
|
||||
C11 Atomics,c11_atomics/test_c11_atomics
|
||||
Execution Model,device_execution/test_device_execution
|
||||
Generic Address Space,generic_address_space/test_generic_address_space
|
||||
Non Uniform Work Groups,non_uniform_work_group/test_non_uniform_work_group
|
||||
Pipes,pipes/test_pipes
|
||||
SVM,SVM/test_SVM
|
||||
Workgroups,workgroups/test_workgroups
|
||||
|
||||
#####################################
|
||||
# OpenCL 2.1 tests
|
||||
#####################################
|
||||
Device timer,device_timer/test_device_timer
|
||||
SPIRV new,spirv_new/test_spirv_new -ILPath spirv_bin
|
||||
|
||||
#########################################
|
||||
# Extensions
|
||||
#########################################
|
||||
SPIR,spir/test_spir
|
||||
Mipmaps (Kernel),images/kernel_read_write/test_image_streams test_mipmaps CL_FILTER_NEAREST
|
||||
Mipmaps (clCopyImage),images/clCopyImage/test_cl_copy_images test_mipmaps
|
||||
Mipmaps (clReadWriteImage),images/clReadWriteImage/test_cl_read_write_images test_mipmaps
|
||||
Subgroups,subgroups/test_subgroups
|
||||
|
||||
|
38
test_conformance/spirv_new/CMakeLists.txt
Normal file
38
test_conformance/spirv_new/CMakeLists.txt
Normal file
@@ -0,0 +1,38 @@
|
||||
######################################################################################################
|
||||
#Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved.
|
||||
#
|
||||
#This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc.
|
||||
#This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to
|
||||
#third parties, and may not be reproduced, republished, distributed, transmitted, displayed,
|
||||
#broadcast or otherwise exploited in any manner without the express prior written permission
|
||||
#of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce,
|
||||
#disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe,
|
||||
#in whole or in part other than under the terms of the Khronos Adopters Agreement
|
||||
#or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient.
|
||||
######################################################################################################
|
||||
|
||||
set(MODULE_NAME SPIRV_NEW)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
file(GLOB SPIRV_NEW_SOURCES "*.cpp")
|
||||
|
||||
set(TEST_HARNESS_SOURCES
|
||||
../../test_common/harness/crc32.c
|
||||
../../test_common/harness/errorHelpers.c
|
||||
../../test_common/harness/threadTesting.c
|
||||
../../test_common/harness/testHarness.c
|
||||
../../test_common/harness/kernelHelpers.c
|
||||
../../test_common/harness/typeWrappers.cpp
|
||||
../../test_common/harness/mt19937.c
|
||||
../../test_common/harness/conversions.c
|
||||
../../test_common/harness/msvc9.c
|
||||
../../test_common/harness/rounding_mode.c
|
||||
../../test_common/harness/os_helpers.cpp
|
||||
../../test_common/harness/parseParameters.cpp
|
||||
../../test_conformance/math_brute_force/reference_math.c
|
||||
../../test_conformance/math_brute_force/Utility.c
|
||||
)
|
||||
|
||||
set(${MODULE_NAME}_SOURCES ${SPIRV_NEW_SOURCES} ${TEST_HARNESS_SOURCES})
|
||||
|
||||
include(../CMakeCommon.txt)
|
||||
13
test_conformance/spirv_new/README.txt
Normal file
13
test_conformance/spirv_new/README.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
test_conformance/spirv_new README
|
||||
==================================
|
||||
|
||||
The text versions of the spirv files are present in `conformance-tests/test_conformance/spriv_new/spirv_txt`.
|
||||
These text files have been used to generate the binaries in `spirv_bin` using the assembler from `spirv-tools`.
|
||||
|
||||
The absolute path to `spirv_bin` needs to be passed after `-ILPath` token for the test to find the SPIRV binaries.
|
||||
|
||||
An example invocation looks like the following:
|
||||
|
||||
```
|
||||
./test_conformance/spirv_new/test_conformance_spirv_new -ILPath /home/user/workspace/conformance-tests/test_conformance/spirv_new/spirv_bin/ [other options]
|
||||
```
|
||||
217
test_conformance/spirv_new/main.cpp
Normal file
217
test_conformance/spirv_new/main.cpp
Normal file
@@ -0,0 +1,217 @@
|
||||
/******************************************************************
|
||||
Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved.
|
||||
|
||||
This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc.
|
||||
This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to
|
||||
third parties, and may not be reproduced, republished, distributed, transmitted, displayed,
|
||||
broadcast or otherwise exploited in any manner without the express prior written permission
|
||||
of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce,
|
||||
disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe,
|
||||
in whole or in part other than under the terms of the Khronos Adopters Agreement
|
||||
or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient.
|
||||
******************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "procs.h"
|
||||
#if !defined(_WIN32)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
#if defined(_WIN32)
|
||||
const std::string slash = "\\";
|
||||
#else
|
||||
const std::string slash = "/";
|
||||
#endif
|
||||
|
||||
const std::string spvExt = ".spv";
|
||||
std::string gAddrWidth = "";
|
||||
std::string spvBinariesPath = "spirv_bin";
|
||||
std::string spvBinariesPathArg = "--spirv-binaries-path";
|
||||
|
||||
std::vector<unsigned char> readBinary(const char *file_name)
|
||||
{
|
||||
using namespace std;
|
||||
|
||||
ifstream file(file_name, ios::in | ios::binary | ios::ate);
|
||||
|
||||
std::vector<char> tmpBuffer(0);
|
||||
|
||||
if (file.is_open()) {
|
||||
size_t size = file.tellg();
|
||||
tmpBuffer.resize(size);
|
||||
file.seekg(0, ios::beg);
|
||||
file.read(&tmpBuffer[0], size);
|
||||
file.close();
|
||||
} else {
|
||||
log_error("File %s not found\n", file_name);
|
||||
}
|
||||
|
||||
std::vector<unsigned char> result(tmpBuffer.begin(), tmpBuffer.end());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
std::vector<unsigned char> readSPIRV(const char *file_name)
|
||||
{
|
||||
std::string full_name_str = spvBinariesPath + slash + file_name + spvExt + gAddrWidth;
|
||||
return readBinary(full_name_str.c_str());
|
||||
}
|
||||
|
||||
test_definition *spirvTestsRegistry::getTestDefinitions()
|
||||
{
|
||||
return &testDefinitions[0];
|
||||
}
|
||||
|
||||
size_t spirvTestsRegistry::getNumTests()
|
||||
{
|
||||
return testDefinitions.size();
|
||||
}
|
||||
|
||||
void spirvTestsRegistry::addTestClass(baseTestClass *test, const char *testName)
|
||||
{
|
||||
|
||||
testClasses.push_back(test);
|
||||
test_definition testDef;
|
||||
testDef.func = test->getFunction();
|
||||
testDef.name = testName;
|
||||
testDef.min_version = Version(2, 1);
|
||||
testDefinitions.push_back(testDef);
|
||||
}
|
||||
|
||||
spirvTestsRegistry& spirvTestsRegistry::getInstance()
|
||||
{
|
||||
static spirvTestsRegistry instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
static int offline_get_program_with_il(clProgramWrapper &prog,
|
||||
const cl_device_id deviceID,
|
||||
const cl_context context,
|
||||
const char *prog_name)
|
||||
{
|
||||
cl_int err = 0;
|
||||
std::string outputTypeStr = "binary";
|
||||
std::string defaultScript = std::string("..") + slash + std::string("spv_to_binary.py");
|
||||
std::string outputFilename = spvBinariesPath + slash + std::string(prog_name);
|
||||
std::string sourceFilename = outputFilename + spvExt;
|
||||
|
||||
std::string scriptArgs =
|
||||
sourceFilename + " " +
|
||||
outputFilename + " " +
|
||||
gAddrWidth + " " +
|
||||
outputTypeStr + " " +
|
||||
"-cl-std=CL2.0";
|
||||
|
||||
std::string scriptToRunString = defaultScript + scriptArgs;
|
||||
|
||||
// execute script
|
||||
log_info("Executing command: %s\n", scriptToRunString.c_str());
|
||||
fflush(stdout);
|
||||
int returnCode = system(scriptToRunString.c_str());
|
||||
if (returnCode != 0) {
|
||||
log_error("Command finished with error: 0x%x\n", returnCode);
|
||||
return CL_COMPILE_PROGRAM_FAILURE;
|
||||
}
|
||||
|
||||
// read output file
|
||||
std::vector<unsigned char> buffer_vec = readBinary(outputFilename.c_str());
|
||||
size_t file_bytes = buffer_vec.size();
|
||||
if (file_bytes == 0) {
|
||||
log_error("OfflinerCompiler: Failed to open binary file: %s", outputFilename.c_str());
|
||||
return -1;
|
||||
}
|
||||
|
||||
const unsigned char *buffer = &buffer_vec[0];
|
||||
cl_int status = 0;
|
||||
prog = clCreateProgramWithBinary(context, 1, &deviceID, &file_bytes, &buffer, &status, &err);
|
||||
SPIRV_CHECK_ERROR((err || status), "Failed to create program with clCreateProgramWithBinary");
|
||||
return err;
|
||||
}
|
||||
|
||||
int get_program_with_il(clProgramWrapper &prog,
|
||||
const cl_device_id deviceID,
|
||||
const cl_context context,
|
||||
const char *prog_name)
|
||||
{
|
||||
cl_int err = 0;
|
||||
if (gCompilationMode == kBinary) {
|
||||
return offline_get_program_with_il(prog, deviceID, context, prog_name);
|
||||
}
|
||||
|
||||
std::vector<unsigned char> buffer_vec = readSPIRV(prog_name);
|
||||
|
||||
int file_bytes = buffer_vec.size();
|
||||
if (file_bytes == 0) {
|
||||
log_error("File %s not found\n", prog_name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
unsigned char *buffer = &buffer_vec[0];
|
||||
prog = clCreateProgramWithIL(context, buffer, file_bytes, &err);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to create program with clCreateProgramWithIL");
|
||||
|
||||
err = clBuildProgram(prog, 1, &deviceID, NULL, NULL, NULL);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to build program");
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
test_status checkAddressWidth(cl_device_id id)
|
||||
{
|
||||
cl_uint address_bits;
|
||||
cl_uint err = clGetDeviceInfo(id, CL_DEVICE_ADDRESS_BITS, sizeof(cl_uint), &address_bits, NULL);
|
||||
if(err != CL_SUCCESS){
|
||||
log_error("clGetDeviceInfo failed to get address bits!");
|
||||
return TEST_FAIL;
|
||||
}
|
||||
|
||||
gAddrWidth = address_bits == 32 ? "32" : "64";
|
||||
return TEST_PASS;
|
||||
}
|
||||
|
||||
void printUsage() {
|
||||
log_info("Reading SPIR-V files from default '%s' path.\n", spvBinariesPath.c_str());
|
||||
log_info("In case you want to set other directory use '%s' argument.\n", spvBinariesPathArg.c_str());
|
||||
}
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
gReSeed = 1;
|
||||
bool modifiedSpvBinariesPath = false;
|
||||
for (int i = 0; i < argc; ++i) {
|
||||
int argsRemoveNum = 0;
|
||||
if (argv[i] == spvBinariesPathArg) {
|
||||
if (i + 1 == argc) {
|
||||
log_error("Missing value for '%s' argument.\n", spvBinariesPathArg.c_str());
|
||||
return TEST_FAIL;
|
||||
} else {
|
||||
spvBinariesPath = std::string(argv[i + 1]);
|
||||
argsRemoveNum += 2;
|
||||
modifiedSpvBinariesPath = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (argsRemoveNum > 0) {
|
||||
for (int j = i; j < (argc - argsRemoveNum); ++j)
|
||||
argv[j] = argv[j + argsRemoveNum];
|
||||
|
||||
argc -= argsRemoveNum;
|
||||
--i;
|
||||
}
|
||||
}
|
||||
if (modifiedSpvBinariesPath == false) {
|
||||
printUsage();
|
||||
}
|
||||
|
||||
return runTestHarnessWithCheck(argc, argv,
|
||||
spirvTestsRegistry::getInstance().getNumTests(),
|
||||
spirvTestsRegistry::getInstance().getTestDefinitions(),
|
||||
false, false, 0, checkAddressWidth);
|
||||
}
|
||||
98
test_conformance/spirv_new/procs.h
Normal file
98
test_conformance/spirv_new/procs.h
Normal file
@@ -0,0 +1,98 @@
|
||||
/******************************************************************
|
||||
Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved.
|
||||
|
||||
This code is protected by copyright laws and contains material proprietary to the Khronos Group, Inc.
|
||||
This is UNPUBLISHED PROPRIETARY SOURCE CODE that may not be disclosed in whole or in part to
|
||||
third parties, and may not be reproduced, republished, distributed, transmitted, displayed,
|
||||
broadcast or otherwise exploited in any manner without the express prior written permission
|
||||
of Khronos Group. The receipt or possession of this code does not convey any rights to reproduce,
|
||||
disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe,
|
||||
in whole or in part other than under the terms of the Khronos Adopters Agreement
|
||||
or Khronos Conformance Test Source License Agreement as executed between Khronos and the recipient.
|
||||
******************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../../test_common/harness/errorHelpers.h"
|
||||
#include "../../test_common/harness/kernelHelpers.h"
|
||||
#include "../../test_common/harness/typeWrappers.h"
|
||||
#include "../../test_common/harness/conversions.h"
|
||||
#include "../../test_common/harness/mt19937.h"
|
||||
#include "../../test_common/harness/compat.h"
|
||||
#include "../../test_common/harness/testHarness.h"
|
||||
#include "../../test_common/harness/parseParameters.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
#define SPIRV_CHECK_ERROR(err, fmt, ...) do { \
|
||||
if (err == CL_SUCCESS) break; \
|
||||
log_error("%s(%d): Error %d\n" fmt "\n", \
|
||||
__FILE__, __LINE__, err, ##__VA_ARGS__); \
|
||||
return -1; \
|
||||
} while(0)
|
||||
|
||||
|
||||
class baseTestClass
|
||||
{
|
||||
public:
|
||||
baseTestClass() {}
|
||||
virtual basefn getFunction() = 0;
|
||||
};
|
||||
|
||||
class spirvTestsRegistry {
|
||||
private:
|
||||
std::vector<baseTestClass *> testClasses;
|
||||
std::vector<test_definition> testDefinitions;
|
||||
|
||||
public:
|
||||
|
||||
static spirvTestsRegistry& getInstance();
|
||||
|
||||
test_definition *getTestDefinitions();
|
||||
|
||||
size_t getNumTests();
|
||||
|
||||
void addTestClass(baseTestClass *test, const char *testName);
|
||||
spirvTestsRegistry() {}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
T* createAndRegister(const char *name)
|
||||
{
|
||||
T *testClass = new T();
|
||||
spirvTestsRegistry::getInstance().addTestClass((baseTestClass *)testClass, name);
|
||||
return testClass;
|
||||
}
|
||||
|
||||
#define TEST_SPIRV_FUNC(name) \
|
||||
extern int test_##name(cl_device_id deviceID, \
|
||||
cl_context context, \
|
||||
cl_command_queue queue, \
|
||||
int num_elements); \
|
||||
class test_##name##_class : public baseTestClass \
|
||||
{ \
|
||||
private: \
|
||||
basefn fn; \
|
||||
\
|
||||
public: \
|
||||
test_##name##_class() : fn(test_##name) \
|
||||
{ \
|
||||
} \
|
||||
basefn getFunction() \
|
||||
{ \
|
||||
return fn; \
|
||||
} \
|
||||
}; \
|
||||
test_##name##_class *var_##name = \
|
||||
createAndRegister<test_##name##_class>(#name); \
|
||||
int test_##name(cl_device_id deviceID, \
|
||||
cl_context context, \
|
||||
cl_command_queue queue, \
|
||||
int num_elements)
|
||||
|
||||
std::vector<unsigned char> readSPIRV(const char *file_name);
|
||||
|
||||
int get_program_with_il(clProgramWrapper &prog,
|
||||
const cl_device_id deviceID,
|
||||
const cl_context context,
|
||||
const char *prog_name);
|
||||
BIN
test_conformance/spirv_new/spirv_bin/atomic_dec_global.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/atomic_dec_global.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/atomic_dec_global.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/atomic_dec_global.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/atomic_inc_global.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/atomic_inc_global.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/atomic_inc_global.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/atomic_inc_global.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/branch_conditional.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/branch_conditional.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/branch_conditional.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/branch_conditional.spv64
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/branch_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/branch_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/branch_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/branch_simple.spv64
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_char_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_char_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_char_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_char_simple.spv64
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_false_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_false_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_false_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_false_simple.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_float_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_float_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_float_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_float_simple.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_half_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_half_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_half_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_half_simple.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_int3_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_int3_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_int3_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_int3_simple.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_int4_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_int4_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_int4_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_int4_simple.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_int_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_int_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_int_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_int_simple.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_long_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_long_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_long_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_long_simple.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_short_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_short_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_short_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_short_simple.spv64
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_true_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_true_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_true_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_true_simple.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_uchar_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_uchar_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_uchar_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_uchar_simple.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_uint_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_uint_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_uint_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_uint_simple.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_ulong_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_ulong_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/constant_ulong_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/constant_ulong_simple.spv64
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_char_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_char_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_char_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_char_simple.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_double_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_double_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_double_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_double_simple.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_float_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_float_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_float_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_float_simple.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_half_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_half_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_half_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_half_simple.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_int3_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_int3_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_int3_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_int3_simple.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_int4_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_int4_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_int4_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_int4_simple.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_int_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_int_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_int_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_int_simple.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_long_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_long_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_long_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_long_simple.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_short_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_short_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_short_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_short_simple.spv64
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_uchar_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_uchar_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_uchar_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_uchar_simple.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_uint_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_uint_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_uint_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_uint_simple.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_ulong_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_ulong_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_ulong_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_ulong_simple.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_ushort_simple.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_ushort_simple.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/copy_ushort_simple.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/copy_ushort_simple.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/decorate_aliased.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/decorate_aliased.spv32
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/decorate_aliased.spv64
Normal file
BIN
test_conformance/spirv_new/spirv_bin/decorate_aliased.spv64
Normal file
Binary file not shown.
BIN
test_conformance/spirv_new/spirv_bin/decorate_alignment.spv32
Normal file
BIN
test_conformance/spirv_new/spirv_bin/decorate_alignment.spv32
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user