mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-24 15:59:03 +00:00
update fp16 staging branch from main (#1903)
* allocations: Move results array from stack to heap (#1857) * allocations: Fix stack overflow * check format fixes * Fix windows stack overflow. (#1839) * thread_dimensions: Avoid combinations of very small LWS and very large GWS (#1856) Modify the existing condition to include extremely small LWS like 1x1 on large GWS values * c11_atomics: Reduce the loopcounter for sequential consistency tests (#1853) Reduce the loop from 1000000 to 500000 since the former value makes the test run too long and cause system issues on certain platforms * Limit individual allocation size using the global memory size (#1835) Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com> * geometrics: fix Wsign-compare warnings (#1855) Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com> * integer_ops: fix -Wformat warnings (#1860) The main sources of warnings were: * Printing of a `size_t` which requires the `%zu` specifier. * Printing of `cl_long`/`cl_ulong` which is now done using the `PRI*64` macros to ensure portability across 32 and 64-bit builds. Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com> * Replace OBSOLETE_FORAMT with OBSOLETE_FORMAT (#1776) * Replace OBSOLETE_FORAMT with OBSOLETE_FORMAT In imageHelpers.cpp and few other places in image tests, OBSOLETE_FORMAT is misspelled as OBSOLETE_FORAMT. Fix misspelling by replcaing it with OBSOLETE_FORMAT. Fixes #1769 * Remove code guarded by OBSOLETE_FORMAT Remove code guarded by OBSOLETE_FORMAT as suggested by review comments Fixes #1769 * Fix formating issues for OBSOLETE_FORMAT changes Fix formatting issues observed in files while removing code guarded by OBSOLETE_FORMAT Fixes #1769 * Some more formatting fixes Some more formatting fixes to get CI clean Fixes #1769 * Final Formating fixes Final formatting fixes for #1769 * Enhancement: Thread dimensions user parameters (#1384) * Fix format in the test scope * Add user params to limit testing Add parameters to reduce amount of testing. Helpful for debugging or for machines with lower performance. * Restore default value * Print info only if testing params bigger than 0. * [NFC] conversions: reenable Wunused-but-set-variable (#1845) Remove an assigned-to but unused variable. Reenable the Wunused-but-set-variable warning for the conversions suite, as it now compiles cleanly with this warning enabled. Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com> * Fix bug of conversion from long to double (#1847) * Fix bug of conversion from long to double It the input is long type, it should be load as long type, not ulong. * update long2float * math_brute_force: fix exp/exp2 rlx ULP calculation (#1848) Fix the ULP error calculation for the `exp` and `exp2` builtins in relaxed math mode for the full profile. Previously, the `ulps` value kept being added to while verifying the result buffer in a loop. `ulps` could even become a `NaN` when the input argument being tested was a `NaN`. Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com> * Enable LARGEADDRESSAWARE for 32 bit compilation (#1858) * Enable LARGEADDRESSAWARE for 32 bit compilation 32-bit executables built with MSVC linker have only 2GB virtual memory address space by default, which might not be sufficient for some tests. Enable LARGEADDRESSAWARE linker flag for 32-bit targets to allow tests to handle addresses larger than 2 gigabytes. https://learn.microsoft.com/en-us/cpp/build/reference/largeaddressaware-handle-large-addresses?view=msvc-170 Signed-off-by: Guo, Yilong <yilong.guo@intel.com> * Apply suggestion Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com> --------- Signed-off-by: Guo, Yilong <yilong.guo@intel.com> Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com> * fix return code when readwrite image is not supported (#1873) This function (do_test) starts by testing write and read individually. Both of them can have errors. When readwrite image is not supported, the function returns TEST_SKIPPED_ITSELF potentially masking errors leading to the test returning EXIT_SUCCESS even with errors along the way. * fix macos builds by avoiding double compilation of function_list.cpp for test_spir (#1866) * modernize CMakeLists for test_spir * add the operating system release to the sccache key * include the math brute force function list vs. building it twice * fix the license header on the spirv-new tests (#1865) The source files for the spirv-new tests were using the older Khronos license instead of the proper Apache license. Fixed the license in all source files. * compiler: fix grammar in error message (#1877) Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com> * Updated semaphore tests to use clSemaphoreReImportSyncFdKHR. (#1854) * Updated semaphore tests to use clSemaphoreReImportSyncFdKHR. Additionally updated common semaphore code to handle spec updates that restrict simultaneous importing/exporting of handles. * Fix build issues on CI * gcc build issues * Make clReImportSemaphoreSyncFdKHR a required API call if cl_khr_external_semaphore_sync_fd is present. * Implement signal and wait for all semaphore types. * subgroups: fix for testing too large WG sizes (#1620) It seemed to be a typo; the comment says that it tries to fetch local size for a subgroup count with above max WG size, but it just used the previous subgroup count. The test on purpose sets a SG count to be a larger number than the max work-items in the work group. Given the minimum SG size is 1 WI, it means that there can be a maximum of maximum work-group size of SGs (of 1 WI of size). Thus, if we request a number of SGs that exceeds the local size, the query should fail as expected. * add SPIR-V version testing (#1861) * basic SPIR-V 1.3 testing support * updated script to compile for more SPIR-V versions * switch to general SPIR-V versions test * update copyright text and fix license * improve output while test is running * check for higher SPIR-V versions first * fix formatting * fix the reported platform information for math brute force (#1884) When the math brute force test printed the platform version it always printed information for the first platform in the system, which could be different than the platform for the passed-in device. Fixed by querying the platform from the passed-in device instead. * api tests fix: Use MTdataHolder in test_get_image_info (#1871) * Minor fixes in mutable dispatch tests. (#1829) * Minor fixes in mutable dispatch tests. * Fix size of newWrapper in MutableDispatchSVMArguments. * Fix errnoneus clCommandNDRangeKernelKHR call. Signed-off-by: John Kesapides <john.kesapides@arm.com> * * Set the row_pitch for imageInfo in MutableDispatchImage1DArguments and MutableDispatchImage2DArguments. The row_pitch is used by get_image_size() to calculate the size of the host pointers by generate_random_image_data. Signed-off-by: John Kesapides <john.kesapides@arm.com> --------- Signed-off-by: John Kesapides <john.kesapides@arm.com> * add test for cl_khr_spirv_linkonce_odr (#1226) * initial version of the test with placeholders for linkonce_odr linkage * add OpExtension SPV_KHR_linkonce_odr extension * add check for extension * switch to actual LinkOnceODR linkage * fix formatting * add a test case to ensure a function with linkonce_odr is exported * add back the extension check * fix formatting * undo compiler optimization and actually add the call to function a * [NFC] subgroups: remove unnecessary extern keywords (#1892) In C and C++ all functions have external linkage by default. Also remove the unused `gMTdata` and `test_pipe_functions` declarations. Fixes https://github.com/KhronosGroup/OpenCL-CTS/issues/1137 Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com> * Added cl_khr_fp16 extension support for test_decorate from spirv_new (#1770) * Added cl_khr_fp16 extension support for test_decorate from spirv_new, work in progres * Complemented test_decorate saturation test to support cl_khr_fp16 extension (issue #142) * Fixed clang format * scope of modifications: -changed naming convention of saturation .spvasm files related to test_decorate of spirv_new -restored float to char/uchar saturation tests -few minor corrections * fix ranges for half testing * fix formating * one more formatting fix * remove unused function * use isnan instead of std::isnan isnan is currently implemented as a macro, not as a function, so we can't use std::isnan. * fix Clang warning about inexact conversion --------- Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com> * add support for custom devices (#1891) enable the CTS to run on custom devices --------- Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com> Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com> Signed-off-by: Guo, Yilong <yilong.guo@intel.com> Signed-off-by: John Kesapides <john.kesapides@arm.com> Co-authored-by: Sreelakshmi Haridas Maruthur <sharidas@quicinc.com> Co-authored-by: Haonan Yang <haonan.yang@intel.com> Co-authored-by: Ahmed Hesham <117350656+ahesham-arm@users.noreply.github.com> Co-authored-by: Sven van Haastregt <sven.vanhaastregt@arm.com> Co-authored-by: niranjanjoshi121 <43807392+niranjanjoshi121@users.noreply.github.com> Co-authored-by: Grzegorz Wawiorko <grzegorz.wawiorko@intel.com> Co-authored-by: Wenwan Xing <wenwan.xing@intel.com> Co-authored-by: Yilong Guo <yilong.guo@intel.com> Co-authored-by: Romaric Jodin <89833130+rjodinchr@users.noreply.github.com> Co-authored-by: joshqti <127994991+joshqti@users.noreply.github.com> Co-authored-by: Pekka Jääskeläinen <pekka.jaaskelainen@tuni.fi> Co-authored-by: imilenkovic00 <155085410+imilenkovic00@users.noreply.github.com> Co-authored-by: John Kesapides <46718829+JohnKesapidesARM@users.noreply.github.com> Co-authored-by: Marcin Hajder <marcin.hajder@gmail.com> Co-authored-by: Aharon Abramson <aharon.abramson@mobileye.com>
This commit is contained in:
@@ -1,16 +1,3 @@
|
||||
######################################################################################################
|
||||
#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)
|
||||
|
||||
file(GLOB SPIRV_NEW_SOURCES "*.cpp")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
#####################################################################
|
||||
# Copyright (c) 2020 The Khronos Group Inc. All Rights Reserved.
|
||||
# Copyright (c) 2020-2023 The Khronos Group Inc. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -30,6 +30,16 @@ import subprocess
|
||||
import sys
|
||||
from textwrap import wrap
|
||||
|
||||
# sub-directories for specific SPIR-V environments
|
||||
spirv_envs = [
|
||||
'', # all files in the root directory are considered SPIR-V 1.0
|
||||
'spv1.1',
|
||||
'spv1.2',
|
||||
'spv1.3',
|
||||
'spv1.4',
|
||||
'spv1.5',
|
||||
'spv1.6',
|
||||
]
|
||||
|
||||
def fatal(message):
|
||||
"""Print an error message and exit with a non-zero status, to
|
||||
@@ -39,7 +49,7 @@ def fatal(message):
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def assemble_spirv(asm_dir, bin_dir, spirv_as, verbose):
|
||||
def assemble_spirv(asm_dir, bin_dir, spirv_as, spirv_env, verbose):
|
||||
"""Assemble SPIR-V source into binaries."""
|
||||
|
||||
if not os.path.exists(bin_dir):
|
||||
@@ -57,8 +67,8 @@ def assemble_spirv(asm_dir, bin_dir, spirv_as, verbose):
|
||||
bin_file = asm_file_root + asm_file_ext.replace('asm', '')
|
||||
bin_file_path = os.path.join(bin_dir, bin_file)
|
||||
|
||||
command = '"{}" --target-env spv1.0 "{}" -o "{}"'.format(
|
||||
spirv_as, asm_file_path, bin_file_path)
|
||||
command = '"{}" --target-env "{}" "{}" -o "{}"'.format(
|
||||
spirv_as, spirv_env, asm_file_path, bin_file_path)
|
||||
if subprocess.call(command, shell=True) != 0:
|
||||
assembly_failures = True
|
||||
print('ERROR: Failure assembling {}: '
|
||||
@@ -72,7 +82,7 @@ def assemble_spirv(asm_dir, bin_dir, spirv_as, verbose):
|
||||
'messages from the assembler, if any.')))
|
||||
|
||||
|
||||
def validate_spirv(bin_dir, spirv_val, verbose):
|
||||
def validate_spirv(bin_dir, spirv_val, spirv_env, verbose):
|
||||
"""Validates SPIR-V binaries. Ignores known failures."""
|
||||
|
||||
validation_failures = False
|
||||
@@ -83,8 +93,8 @@ def validate_spirv(bin_dir, spirv_val, verbose):
|
||||
if verbose:
|
||||
print(' Validating {}'.format(bin_file))
|
||||
|
||||
command = '"{}" "{}"'.format(
|
||||
spirv_val, bin_file_path)
|
||||
command = '"{}" --target-env "{}" "{}"'.format(
|
||||
spirv_val, spirv_env, bin_file_path)
|
||||
if subprocess.call(command, shell=True) != 0:
|
||||
print('ERROR: Failure validating {}: '
|
||||
'see above output.'.format(
|
||||
@@ -95,8 +105,6 @@ def validate_spirv(bin_dir, spirv_val, verbose):
|
||||
if validation_failures:
|
||||
fatal('ERROR: Validation failure(s) found. '
|
||||
'See above for validation output.')
|
||||
else:
|
||||
print('All SPIR-V binaries validated successfully.')
|
||||
|
||||
|
||||
def parse_args():
|
||||
@@ -144,18 +152,26 @@ def main():
|
||||
|
||||
args = parse_args()
|
||||
|
||||
print('Assembling SPIR-V source into binaries...')
|
||||
assemble_spirv(args.source_dir, args.output_dir, args.assembler,
|
||||
args.verbose)
|
||||
print('Finished assembling SPIR-V binaries.')
|
||||
print()
|
||||
for subdir in spirv_envs:
|
||||
src_dir = os.path.join(args.source_dir, subdir)
|
||||
out_dir = os.path.join(args.output_dir, subdir)
|
||||
spirv_env = 'spv1.0' if subdir == '' else subdir
|
||||
print('Assembling SPIR-V source into binaries for target {}...'.
|
||||
format(spirv_env))
|
||||
assemble_spirv(src_dir, out_dir, args.assembler,
|
||||
spirv_env, args.verbose)
|
||||
print('Finished assembling SPIR-V binaries.')
|
||||
print()
|
||||
|
||||
if args.skip_validation:
|
||||
print('Skipping validation of SPIR-V binaries as requested.')
|
||||
else:
|
||||
print('Validating SPIR-V binaries...')
|
||||
validate_spirv(args.output_dir, args.validator, args.verbose)
|
||||
print()
|
||||
if args.skip_validation:
|
||||
print('Skipping validation of SPIR-V binaries as requested.')
|
||||
else:
|
||||
print('Validating SPIR-V binaries for target {}...'.
|
||||
format(spirv_env))
|
||||
validate_spirv(out_dir, args.validator,
|
||||
spirv_env, args.verbose)
|
||||
print('All SPIR-V binaries validated successfully.')
|
||||
print()
|
||||
|
||||
print('Done.')
|
||||
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
/******************************************************************
|
||||
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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2016-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@@ -30,9 +33,12 @@ const std::string slash = "/";
|
||||
#endif
|
||||
|
||||
const std::string spvExt = ".spv";
|
||||
bool gVersionSkip = false;
|
||||
std::string gAddrWidth = "";
|
||||
std::string spvBinariesPath = "spirv_bin";
|
||||
std::string spvBinariesPathArg = "--spirv-binaries-path";
|
||||
|
||||
const std::string spvBinariesPathArg = "--spirv-binaries-path";
|
||||
const std::string spvVersionSkipArg = "--skip-spirv-version-check";
|
||||
|
||||
std::vector<unsigned char> readBinary(const char *file_name)
|
||||
{
|
||||
@@ -224,7 +230,10 @@ test_status InitCL(cl_device_id id)
|
||||
|
||||
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());
|
||||
log_info("In case you want to set other directory use '%s' argument.\n",
|
||||
spvBinariesPathArg.c_str());
|
||||
log_info("To skip the SPIR-V version check use the '%s' argument.\n",
|
||||
spvVersionSkipArg.c_str());
|
||||
}
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
@@ -243,6 +252,11 @@ int main(int argc, const char *argv[])
|
||||
modifiedSpvBinariesPath = true;
|
||||
}
|
||||
}
|
||||
if (argv[i] == spvVersionSkipArg)
|
||||
{
|
||||
gVersionSkip = true;
|
||||
argsRemoveNum++;
|
||||
}
|
||||
|
||||
if (argsRemoveNum > 0) {
|
||||
for (int j = i; j < (argc - argsRemoveNum); ++j)
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
/******************************************************************
|
||||
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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2016-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
33
test_conformance/spirv_new/spirv_asm/basic.spvasm32
Normal file
33
test_conformance/spirv_new/spirv_asm/basic.spvasm32
Normal file
@@ -0,0 +1,33 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 18
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %9 "test_basic" %gl_GlobalInvocationID
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
|
||||
%9 = OpFunction %void None %8
|
||||
%10 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%11 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%12 = OpLabel
|
||||
%13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 16
|
||||
%14 = OpCompositeExtract %uint %13 0
|
||||
%15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %11 %14
|
||||
%16 = OpLoad %uint %15 Aligned 4
|
||||
%17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %10 %14
|
||||
OpStore %17 %16 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
38
test_conformance/spirv_new/spirv_asm/basic.spvasm64
Normal file
38
test_conformance/spirv_new/spirv_asm/basic.spvasm64
Normal file
@@ -0,0 +1,38 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 22
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %10 "test_basic" %gl_GlobalInvocationID
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
%ulong = OpTypeInt 64 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3ulong = OpTypeVector %ulong 3
|
||||
%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input
|
||||
%10 = OpFunction %void None %9
|
||||
%11 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%12 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%13 = OpLabel
|
||||
%14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 32
|
||||
%15 = OpCompositeExtract %ulong %14 0
|
||||
%16 = OpUConvert %uint %15
|
||||
%17 = OpSConvert %ulong %16
|
||||
%18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %12 %17
|
||||
%19 = OpLoad %uint %18 Aligned 4
|
||||
%20 = OpSConvert %ulong %16
|
||||
%21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %11 %20
|
||||
OpStore %21 %19 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,42 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos SPIR-V Tools Assembler; 0
|
||||
; Bound: 20
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Float16
|
||||
OpCapability Int16
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %1 "decorate_rounding_rte_half_short" %gl_GlobalInvocationID
|
||||
OpName %res "res"
|
||||
OpName %in "in"
|
||||
OpName %entry "entry"
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import
|
||||
OpDecorate %6 FPRoundingMode RTE
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
|
||||
%void = OpTypeVoid
|
||||
%ushort = OpTypeInt 16 0
|
||||
%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort
|
||||
%half = OpTypeFloat 16
|
||||
%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half
|
||||
%14 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort %_ptr_CrossWorkgroup_half
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
|
||||
%1 = OpFunction %void None %14
|
||||
%res = OpFunctionParameter %_ptr_CrossWorkgroup_ushort
|
||||
%in = OpFunctionParameter %_ptr_CrossWorkgroup_half
|
||||
%entry = OpLabel
|
||||
%15 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0
|
||||
%16 = OpCompositeExtract %uint %15 0
|
||||
%17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %in %16
|
||||
%18 = OpLoad %half %17 Aligned 2
|
||||
%6 = OpConvertFToS %ushort %18
|
||||
%19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %res %16
|
||||
OpStore %19 %6
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,46 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos SPIR-V Tools Assembler; 0
|
||||
; Bound: 23
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
OpCapability Int16
|
||||
OpCapability Float16
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %1 "decorate_rounding_rte_half_short" %gl_GlobalInvocationID
|
||||
OpName %res "res"
|
||||
OpName %in "in"
|
||||
OpName %entry "entry"
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import
|
||||
OpDecorate %6 FPRoundingMode RTE
|
||||
%ulong = OpTypeInt 64 0
|
||||
%v3ulong = OpTypeVector %ulong 3
|
||||
%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong
|
||||
%void = OpTypeVoid
|
||||
%ushort = OpTypeInt 16 0
|
||||
%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort
|
||||
%half = OpTypeFloat 16
|
||||
%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half
|
||||
%14 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort %_ptr_CrossWorkgroup_half
|
||||
%ulong_32 = OpConstant %ulong 32
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input
|
||||
%1 = OpFunction %void None %14
|
||||
%res = OpFunctionParameter %_ptr_CrossWorkgroup_ushort
|
||||
%in = OpFunctionParameter %_ptr_CrossWorkgroup_half
|
||||
%entry = OpLabel
|
||||
%16 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0
|
||||
%17 = OpCompositeExtract %ulong %16 0
|
||||
%18 = OpShiftLeftLogical %ulong %17 %ulong_32
|
||||
%19 = OpShiftRightArithmetic %ulong %18 %ulong_32
|
||||
%20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %in %19
|
||||
%21 = OpLoad %half %20 Aligned 2
|
||||
%6 = OpConvertFToS %ushort %21
|
||||
%22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %res %19
|
||||
OpStore %22 %6
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,42 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos SPIR-V Tools Assembler; 0
|
||||
; Bound: 21
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Float16
|
||||
OpCapability Int16
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %1 "decorate_rounding_rtn_half_short" %gl_GlobalInvocationID
|
||||
OpName %res "res"
|
||||
OpName %in "in"
|
||||
OpName %entry "entry"
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import
|
||||
OpDecorate %6 FPRoundingMode RTN
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
|
||||
%void = OpTypeVoid
|
||||
%ushort = OpTypeInt 16 0
|
||||
%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort
|
||||
%half = OpTypeFloat 16
|
||||
%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half
|
||||
%15 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort %_ptr_CrossWorkgroup_half
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
|
||||
%1 = OpFunction %void None %15
|
||||
%res = OpFunctionParameter %_ptr_CrossWorkgroup_ushort
|
||||
%in = OpFunctionParameter %_ptr_CrossWorkgroup_half
|
||||
%entry = OpLabel
|
||||
%16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0
|
||||
%17 = OpCompositeExtract %uint %16 0
|
||||
%18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %in %17
|
||||
%19 = OpLoad %half %18 Aligned 2
|
||||
%6 = OpConvertFToS %ushort %19
|
||||
%20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %res %17
|
||||
OpStore %20 %6
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,46 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos SPIR-V Tools Assembler; 0
|
||||
; Bound: 23
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
OpCapability Float16
|
||||
OpCapability Int16
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %1 "decorate_rounding_rtn_half_short" %gl_GlobalInvocationID
|
||||
OpName %res "res"
|
||||
OpName %in "in"
|
||||
OpName %entry "entry"
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import
|
||||
OpDecorate %6 FPRoundingMode RTN
|
||||
%ulong = OpTypeInt 64 0
|
||||
%v3ulong = OpTypeVector %ulong 3
|
||||
%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong
|
||||
%void = OpTypeVoid
|
||||
%ushort = OpTypeInt 16 0
|
||||
%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort
|
||||
%half = OpTypeFloat 16
|
||||
%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half
|
||||
%14 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort %_ptr_CrossWorkgroup_half
|
||||
%ulong_32 = OpConstant %ulong 32
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input
|
||||
%1 = OpFunction %void None %14
|
||||
%res = OpFunctionParameter %_ptr_CrossWorkgroup_ushort
|
||||
%in = OpFunctionParameter %_ptr_CrossWorkgroup_half
|
||||
%entry = OpLabel
|
||||
%16 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0
|
||||
%17 = OpCompositeExtract %ulong %16 0
|
||||
%18 = OpShiftLeftLogical %ulong %17 %ulong_32
|
||||
%19 = OpShiftRightArithmetic %ulong %18 %ulong_32
|
||||
%20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %in %19
|
||||
%21 = OpLoad %half %20 Aligned 2
|
||||
%6 = OpConvertFToS %ushort %21
|
||||
%22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %res %19
|
||||
OpStore %22 %6
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,42 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos SPIR-V Tools Assembler; 0
|
||||
; Bound: 21
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Float16
|
||||
OpCapability Int16
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %1 "decorate_rounding_rtp_half_short" %gl_GlobalInvocationID
|
||||
OpName %res "res"
|
||||
OpName %in "in"
|
||||
OpName %entry "entry"
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import
|
||||
OpDecorate %6 FPRoundingMode RTP
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
|
||||
%void = OpTypeVoid
|
||||
%ushort = OpTypeInt 16 0
|
||||
%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort
|
||||
%half = OpTypeFloat 16
|
||||
%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half
|
||||
%15 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort %_ptr_CrossWorkgroup_half
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
|
||||
%1 = OpFunction %void None %15
|
||||
%res = OpFunctionParameter %_ptr_CrossWorkgroup_ushort
|
||||
%in = OpFunctionParameter %_ptr_CrossWorkgroup_half
|
||||
%entry = OpLabel
|
||||
%16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0
|
||||
%17 = OpCompositeExtract %uint %16 0
|
||||
%18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %in %17
|
||||
%19 = OpLoad %half %18 Aligned 2
|
||||
%6 = OpConvertFToS %ushort %19
|
||||
%20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %res %17
|
||||
OpStore %20 %6
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,46 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos SPIR-V Tools Assembler; 0
|
||||
; Bound: 23
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
OpCapability Float16
|
||||
OpCapability Int16
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %1 "decorate_rounding_rtp_half_short" %gl_GlobalInvocationID
|
||||
OpName %res "res"
|
||||
OpName %in "in"
|
||||
OpName %entry "entry"
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import
|
||||
OpDecorate %6 FPRoundingMode RTP
|
||||
%ulong = OpTypeInt 64 0
|
||||
%v3ulong = OpTypeVector %ulong 3
|
||||
%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong
|
||||
%void = OpTypeVoid
|
||||
%ushort = OpTypeInt 16 0
|
||||
%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort
|
||||
%half = OpTypeFloat 16
|
||||
%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half
|
||||
%14 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort %_ptr_CrossWorkgroup_half
|
||||
%ulong_32 = OpConstant %ulong 32
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input
|
||||
%1 = OpFunction %void None %14
|
||||
%res = OpFunctionParameter %_ptr_CrossWorkgroup_ushort
|
||||
%in = OpFunctionParameter %_ptr_CrossWorkgroup_half
|
||||
%entry = OpLabel
|
||||
%16 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0
|
||||
%17 = OpCompositeExtract %ulong %16 0
|
||||
%18 = OpShiftLeftLogical %ulong %17 %ulong_32
|
||||
%19 = OpShiftRightArithmetic %ulong %18 %ulong_32
|
||||
%20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %in %19
|
||||
%21 = OpLoad %half %20 Aligned 2
|
||||
%6 = OpConvertFToS %ushort %21
|
||||
%22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %res %19
|
||||
OpStore %22 %6
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,42 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos SPIR-V Tools Assembler; 0
|
||||
; Bound: 21
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Float16
|
||||
OpCapability Int16
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %1 "decorate_rounding_rtz_half_short" %gl_GlobalInvocationID
|
||||
OpName %res "res"
|
||||
OpName %in "in"
|
||||
OpName %entry "entry"
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import
|
||||
OpDecorate %6 FPRoundingMode RTZ
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
|
||||
%void = OpTypeVoid
|
||||
%ushort = OpTypeInt 16 0
|
||||
%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort
|
||||
%half = OpTypeFloat 16
|
||||
%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half
|
||||
%15 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort %_ptr_CrossWorkgroup_half
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
|
||||
%1 = OpFunction %void None %15
|
||||
%res = OpFunctionParameter %_ptr_CrossWorkgroup_ushort
|
||||
%in = OpFunctionParameter %_ptr_CrossWorkgroup_half
|
||||
%entry = OpLabel
|
||||
%16 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0
|
||||
%17 = OpCompositeExtract %uint %16 0
|
||||
%18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %in %17
|
||||
%19 = OpLoad %half %18 Aligned 2
|
||||
%6 = OpConvertFToS %ushort %19
|
||||
%20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %res %17
|
||||
OpStore %20 %6
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,46 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos SPIR-V Tools Assembler; 0
|
||||
; Bound: 23
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
OpCapability Float16
|
||||
OpCapability Int16
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %1 "decorate_rounding_rtz_half_short" %gl_GlobalInvocationID
|
||||
OpName %res "res"
|
||||
OpName %in "in"
|
||||
OpName %entry "entry"
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import
|
||||
OpDecorate %6 FPRoundingMode RTZ
|
||||
%ulong = OpTypeInt 64 0
|
||||
%v3ulong = OpTypeVector %ulong 3
|
||||
%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong
|
||||
%void = OpTypeVoid
|
||||
%ushort = OpTypeInt 16 0
|
||||
%_ptr_CrossWorkgroup_ushort = OpTypePointer CrossWorkgroup %ushort
|
||||
%half = OpTypeFloat 16
|
||||
%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half
|
||||
%14 = OpTypeFunction %void %_ptr_CrossWorkgroup_ushort %_ptr_CrossWorkgroup_half
|
||||
%ulong_32 = OpConstant %ulong 32
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input
|
||||
%1 = OpFunction %void None %14
|
||||
%res = OpFunctionParameter %_ptr_CrossWorkgroup_ushort
|
||||
%in = OpFunctionParameter %_ptr_CrossWorkgroup_half
|
||||
%entry = OpLabel
|
||||
%16 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0
|
||||
%17 = OpCompositeExtract %ulong %16 0
|
||||
%18 = OpShiftLeftLogical %ulong %17 %ulong_32
|
||||
%19 = OpShiftRightArithmetic %ulong %18 %ulong_32
|
||||
%20 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %in %19
|
||||
%21 = OpLoad %half %20 Aligned 2
|
||||
%6 = OpConvertFToS %ushort %21
|
||||
%22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_ushort %res %19
|
||||
OpStore %22 %6
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -8,7 +8,7 @@
|
||||
OpCapability Kernel
|
||||
OpCapability Float64
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_int" %gl_GlobalInvocationID
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_double_to_int" %gl_GlobalInvocationID
|
||||
OpName %res "res"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
@@ -9,7 +9,7 @@
|
||||
OpCapability Int64
|
||||
OpCapability Float64
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_uint" %gl_GlobalInvocationID
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_double_to_int" %gl_GlobalInvocationID
|
||||
OpName %res "res"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
@@ -8,7 +8,7 @@
|
||||
OpCapability Kernel
|
||||
OpCapability Float64
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_uint" %gl_GlobalInvocationID
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_double_to_uint" %gl_GlobalInvocationID
|
||||
OpName %res "res"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
@@ -9,7 +9,7 @@
|
||||
OpCapability Int64
|
||||
OpCapability Float64
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_int" %gl_GlobalInvocationID
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_double_to_uint" %gl_GlobalInvocationID
|
||||
OpName %res "res"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
@@ -8,7 +8,7 @@
|
||||
OpCapability Kernel
|
||||
OpCapability Int8
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_char" %gl_GlobalInvocationID
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_float_to_char" %gl_GlobalInvocationID
|
||||
OpName %res "res"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
@@ -9,7 +9,7 @@
|
||||
OpCapability Int64
|
||||
OpCapability Int8
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_char" %gl_GlobalInvocationID
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_float_to_char" %gl_GlobalInvocationID
|
||||
OpName %res "res"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
@@ -8,7 +8,7 @@
|
||||
OpCapability Kernel
|
||||
OpCapability Int16
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_short" %gl_GlobalInvocationID
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_float_to_short" %gl_GlobalInvocationID
|
||||
OpName %res "res"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
@@ -9,7 +9,7 @@
|
||||
OpCapability Int64
|
||||
OpCapability Int16
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_short" %gl_GlobalInvocationID
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_float_to_short" %gl_GlobalInvocationID
|
||||
OpName %res "res"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
@@ -8,7 +8,7 @@
|
||||
OpCapability Kernel
|
||||
OpCapability Int8
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_uchar" %gl_GlobalInvocationID
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_float_to_uchar" %gl_GlobalInvocationID
|
||||
OpName %res "res"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
@@ -9,7 +9,7 @@
|
||||
OpCapability Int64
|
||||
OpCapability Int8
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_uchar" %gl_GlobalInvocationID
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_float_to_uchar" %gl_GlobalInvocationID
|
||||
OpName %res "res"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
@@ -8,7 +8,7 @@
|
||||
OpCapability Kernel
|
||||
OpCapability Int16
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_ushort" %gl_GlobalInvocationID
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_float_to_ushort" %gl_GlobalInvocationID
|
||||
OpName %res "res"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
@@ -9,7 +9,7 @@
|
||||
OpCapability Int64
|
||||
OpCapability Int16
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_ushort" %gl_GlobalInvocationID
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_float_to_ushort" %gl_GlobalInvocationID
|
||||
OpName %res "res"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
@@ -0,0 +1,47 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos SPIR-V Tools Assembler; 0
|
||||
; Bound: 25
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int8
|
||||
OpCapability Float16
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_half_to_char" %gl_GlobalInvocationID
|
||||
OpName %res "res"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
OpName %entry "entry"
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import
|
||||
OpDecorate %7 SaturatedConversion
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
|
||||
%void = OpTypeVoid
|
||||
%uchar = OpTypeInt 8 0
|
||||
%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar
|
||||
%half = OpTypeFloat 16
|
||||
%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half
|
||||
%16 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
|
||||
%1 = OpFunction %void None %16
|
||||
%res = OpFunctionParameter %_ptr_CrossWorkgroup_uchar
|
||||
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_half
|
||||
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_half
|
||||
%entry = OpLabel
|
||||
%17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0
|
||||
%18 = OpCompositeExtract %uint %17 0
|
||||
%19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %lhs %18
|
||||
%20 = OpLoad %half %19 Aligned 2
|
||||
%21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %rhs %18
|
||||
%22 = OpLoad %half %21 Aligned 2
|
||||
%23 = OpFMul %half %20 %22
|
||||
%7 = OpConvertFToS %uchar %23
|
||||
%24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %res %18
|
||||
OpStore %24 %7
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,51 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos SPIR-V Tools Assembler; 0
|
||||
; Bound: 28
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
OpCapability Int8
|
||||
OpCapability Float16
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_half_to_char" %gl_GlobalInvocationID
|
||||
OpName %res "res"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
OpName %entry "entry"
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import
|
||||
OpDecorate %7 SaturatedConversion
|
||||
%ulong = OpTypeInt 64 0
|
||||
%v3ulong = OpTypeVector %ulong 3
|
||||
%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong
|
||||
%void = OpTypeVoid
|
||||
%uchar = OpTypeInt 8 0
|
||||
%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar
|
||||
%half = OpTypeFloat 16
|
||||
%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half
|
||||
%16 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half
|
||||
%ulong_32 = OpConstant %ulong 32
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input
|
||||
%1 = OpFunction %void None %16
|
||||
%res = OpFunctionParameter %_ptr_CrossWorkgroup_uchar
|
||||
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_half
|
||||
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_half
|
||||
%entry = OpLabel
|
||||
%18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0
|
||||
%19 = OpCompositeExtract %ulong %18 0
|
||||
%20 = OpShiftLeftLogical %ulong %19 %ulong_32
|
||||
%21 = OpShiftRightArithmetic %ulong %20 %ulong_32
|
||||
%22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %lhs %21
|
||||
%23 = OpLoad %half %22 Aligned 2
|
||||
%24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %rhs %21
|
||||
%25 = OpLoad %half %24 Aligned 2
|
||||
%26 = OpFMul %half %23 %25
|
||||
%7 = OpConvertFToS %uchar %26
|
||||
%27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %res %21
|
||||
OpStore %27 %7
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,47 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos SPIR-V Tools Assembler; 0
|
||||
; Bound: 25
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int8
|
||||
OpCapability Float16
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_half_to_uchar" %gl_GlobalInvocationID
|
||||
OpName %res "res"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
OpName %entry "entry"
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import
|
||||
OpDecorate %7 SaturatedConversion
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
|
||||
%void = OpTypeVoid
|
||||
%uchar = OpTypeInt 8 0
|
||||
%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar
|
||||
%half = OpTypeFloat 16
|
||||
%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half
|
||||
%16 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
|
||||
%1 = OpFunction %void None %16
|
||||
%res = OpFunctionParameter %_ptr_CrossWorkgroup_uchar
|
||||
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_half
|
||||
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_half
|
||||
%entry = OpLabel
|
||||
%17 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 0
|
||||
%18 = OpCompositeExtract %uint %17 0
|
||||
%19 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %lhs %18
|
||||
%20 = OpLoad %half %19 Aligned 2
|
||||
%21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %rhs %18
|
||||
%22 = OpLoad %half %21 Aligned 2
|
||||
%23 = OpFMul %half %20 %22
|
||||
%7 = OpConvertFToU %uchar %23
|
||||
%24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %res %18
|
||||
OpStore %24 %7
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,51 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos SPIR-V Tools Assembler; 0
|
||||
; Bound: 28
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
OpCapability Int8
|
||||
OpCapability Float16
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %1 "decorate_saturated_conversion_half_to_uchar" %gl_GlobalInvocationID
|
||||
OpName %res "res"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
OpName %entry "entry"
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import
|
||||
OpDecorate %7 SaturatedConversion
|
||||
%ulong = OpTypeInt 64 0
|
||||
%v3ulong = OpTypeVector %ulong 3
|
||||
%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong
|
||||
%void = OpTypeVoid
|
||||
%uchar = OpTypeInt 8 0
|
||||
%_ptr_CrossWorkgroup_uchar = OpTypePointer CrossWorkgroup %uchar
|
||||
%half = OpTypeFloat 16
|
||||
%_ptr_CrossWorkgroup_half = OpTypePointer CrossWorkgroup %half
|
||||
%16 = OpTypeFunction %void %_ptr_CrossWorkgroup_uchar %_ptr_CrossWorkgroup_half %_ptr_CrossWorkgroup_half
|
||||
%ulong_32 = OpConstant %ulong 32
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input
|
||||
%1 = OpFunction %void None %16
|
||||
%res = OpFunctionParameter %_ptr_CrossWorkgroup_uchar
|
||||
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_half
|
||||
%rhs = OpFunctionParameter %_ptr_CrossWorkgroup_half
|
||||
%entry = OpLabel
|
||||
%18 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0
|
||||
%19 = OpCompositeExtract %ulong %18 0
|
||||
%20 = OpShiftLeftLogical %ulong %19 %ulong_32
|
||||
%21 = OpShiftRightArithmetic %ulong %20 %ulong_32
|
||||
%22 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %lhs %21
|
||||
%23 = OpLoad %half %22 Aligned 2
|
||||
%24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_half %rhs %21
|
||||
%25 = OpLoad %half %24 Aligned 2
|
||||
%26 = OpFMul %half %23 %25
|
||||
%7 = OpConvertFToU %uchar %26
|
||||
%27 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uchar %res %21
|
||||
OpStore %27 %7
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,47 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 27
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpExtension "SPV_KHR_linkonce_odr"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %17 "test_linkonce_odr" %__spirv_BuiltInGlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId Constant
|
||||
OpDecorate %18 FuncParamAttr NoCapture
|
||||
OpDecorate %a LinkageAttributes "a" LinkOnceODR
|
||||
OpDecorate %b LinkageAttributes "b" Import
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_5 = OpConstant %uint 5
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
|
||||
%6 = OpTypeFunction %uint %uint
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%16 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint
|
||||
%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3uint Input
|
||||
%b = OpFunction %uint None %6
|
||||
%8 = OpFunctionParameter %uint
|
||||
OpFunctionEnd
|
||||
%a = OpFunction %uint Pure %6
|
||||
%10 = OpFunctionParameter %uint
|
||||
%11 = OpLabel
|
||||
%13 = OpIAdd %uint %10 %uint_5
|
||||
OpReturnValue %13
|
||||
OpFunctionEnd
|
||||
%17 = OpFunction %void None %16
|
||||
%18 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%19 = OpLabel
|
||||
%20 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId Aligned 16
|
||||
%21 = OpCompositeExtract %uint %20 0
|
||||
%22 = OpFunctionCall %uint %a %21
|
||||
%23 = OpFunctionCall %uint %b %21
|
||||
%24 = OpIAdd %uint %22 %23
|
||||
%25 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %18 %21
|
||||
OpStore %25 %24 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,51 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 30
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
OpExtension "SPV_KHR_linkonce_odr"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %18 "test_linkonce_odr" %__spirv_BuiltInGlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId Constant
|
||||
OpDecorate %19 FuncParamAttr NoCapture
|
||||
OpDecorate %a LinkageAttributes "a" LinkOnceODR
|
||||
OpDecorate %b LinkageAttributes "b" Import
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
%ulong = OpTypeInt 64 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_5 = OpConstant %uint 5
|
||||
%v3ulong = OpTypeVector %ulong 3
|
||||
%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong
|
||||
%7 = OpTypeFunction %uint %uint
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%17 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint
|
||||
%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3ulong Input
|
||||
%b = OpFunction %uint None %7
|
||||
%9 = OpFunctionParameter %uint
|
||||
OpFunctionEnd
|
||||
%a = OpFunction %uint Pure %7
|
||||
%11 = OpFunctionParameter %uint
|
||||
%12 = OpLabel
|
||||
%14 = OpIAdd %uint %11 %uint_5
|
||||
OpReturnValue %14
|
||||
OpFunctionEnd
|
||||
%18 = OpFunction %void None %17
|
||||
%19 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%20 = OpLabel
|
||||
%21 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId Aligned 32
|
||||
%22 = OpCompositeExtract %ulong %21 0
|
||||
%23 = OpUConvert %uint %22
|
||||
%24 = OpFunctionCall %uint %a %23
|
||||
%25 = OpFunctionCall %uint %b %23
|
||||
%26 = OpIAdd %uint %24 %25
|
||||
%27 = OpSConvert %ulong %23
|
||||
%28 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %19 %27
|
||||
OpStore %28 %26 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,44 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 27
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpExtension "SPV_KHR_linkonce_odr"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %17 "test_linkonce_odr" %__spirv_BuiltInGlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId Constant
|
||||
OpDecorate %18 FuncParamAttr NoCapture
|
||||
OpDecorate %a LinkageAttributes "a" Import
|
||||
OpDecorate %b LinkageAttributes "b" Import
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_5 = OpConstant %uint 5
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
|
||||
%6 = OpTypeFunction %uint %uint
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%16 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint
|
||||
%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3uint Input
|
||||
%b = OpFunction %uint None %6
|
||||
%8 = OpFunctionParameter %uint
|
||||
OpFunctionEnd
|
||||
%a = OpFunction %uint None %6
|
||||
%10 = OpFunctionParameter %uint
|
||||
OpFunctionEnd
|
||||
%17 = OpFunction %void None %16
|
||||
%18 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%19 = OpLabel
|
||||
%20 = OpLoad %v3uint %__spirv_BuiltInGlobalInvocationId Aligned 16
|
||||
%21 = OpCompositeExtract %uint %20 0
|
||||
%22 = OpFunctionCall %uint %a %21
|
||||
%23 = OpFunctionCall %uint %b %21
|
||||
%24 = OpIAdd %uint %22 %23
|
||||
%25 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %18 %21
|
||||
OpStore %25 %24 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,48 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 30
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
OpExtension "SPV_KHR_linkonce_odr"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %18 "test_linkonce_odr" %__spirv_BuiltInGlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId BuiltIn GlobalInvocationId
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId Constant
|
||||
OpDecorate %19 FuncParamAttr NoCapture
|
||||
OpDecorate %a LinkageAttributes "a" Import
|
||||
OpDecorate %b LinkageAttributes "b" Import
|
||||
OpDecorate %__spirv_BuiltInGlobalInvocationId LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
%ulong = OpTypeInt 64 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_5 = OpConstant %uint 5
|
||||
%v3ulong = OpTypeVector %ulong 3
|
||||
%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong
|
||||
%7 = OpTypeFunction %uint %uint
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%17 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint
|
||||
%__spirv_BuiltInGlobalInvocationId = OpVariable %_ptr_Input_v3ulong Input
|
||||
%b = OpFunction %uint None %7
|
||||
%9 = OpFunctionParameter %uint
|
||||
OpFunctionEnd
|
||||
%a = OpFunction %uint None %7
|
||||
%11 = OpFunctionParameter %uint
|
||||
OpFunctionEnd
|
||||
%18 = OpFunction %void None %17
|
||||
%19 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%20 = OpLabel
|
||||
%21 = OpLoad %v3ulong %__spirv_BuiltInGlobalInvocationId Aligned 32
|
||||
%22 = OpCompositeExtract %ulong %21 0
|
||||
%23 = OpUConvert %uint %22
|
||||
%24 = OpFunctionCall %uint %a %23
|
||||
%25 = OpFunctionCall %uint %b %23
|
||||
%26 = OpIAdd %uint %24 %25
|
||||
%27 = OpSConvert %ulong %23
|
||||
%28 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %19 %27
|
||||
OpStore %28 %26 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,28 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 14
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpExtension "SPV_KHR_linkonce_odr"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpDecorate %a LinkageAttributes "a" LinkOnceODR
|
||||
OpDecorate %b LinkageAttributes "b" Export
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_5 = OpConstant %uint 5
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%3 = OpTypeFunction %uint %uint
|
||||
%a = OpFunction %uint Pure %3
|
||||
%5 = OpFunctionParameter %uint
|
||||
%6 = OpLabel
|
||||
%8 = OpIAdd %uint %5 %uint_5
|
||||
OpReturnValue %8
|
||||
OpFunctionEnd
|
||||
%b = OpFunction %uint Pure %3
|
||||
%10 = OpFunctionParameter %uint
|
||||
%11 = OpLabel
|
||||
%13 = OpISub %uint %uint_0 %10
|
||||
OpReturnValue %13
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,28 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 14
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpExtension "SPV_KHR_linkonce_odr"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpDecorate %a LinkageAttributes "a" LinkOnceODR
|
||||
OpDecorate %b LinkageAttributes "b" Export
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_5 = OpConstant %uint 5
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%3 = OpTypeFunction %uint %uint
|
||||
%a = OpFunction %uint Pure %3
|
||||
%5 = OpFunctionParameter %uint
|
||||
%6 = OpLabel
|
||||
%8 = OpIAdd %uint %5 %uint_5
|
||||
OpReturnValue %8
|
||||
OpFunctionEnd
|
||||
%b = OpFunction %uint Pure %3
|
||||
%10 = OpFunctionParameter %uint
|
||||
%11 = OpLabel
|
||||
%13 = OpISub %uint %uint_0 %10
|
||||
OpReturnValue %13
|
||||
OpFunctionEnd
|
||||
33
test_conformance/spirv_new/spirv_asm/spv1.1/basic.spvasm32
Normal file
33
test_conformance/spirv_new/spirv_asm/spv1.1/basic.spvasm32
Normal file
@@ -0,0 +1,33 @@
|
||||
; SPIR-V
|
||||
; Version: 1.1
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 18
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %9 "test_basic" %gl_GlobalInvocationID
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
|
||||
%9 = OpFunction %void None %8
|
||||
%10 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%11 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%12 = OpLabel
|
||||
%13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 16
|
||||
%14 = OpCompositeExtract %uint %13 0
|
||||
%15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %11 %14
|
||||
%16 = OpLoad %uint %15 Aligned 4
|
||||
%17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %10 %14
|
||||
OpStore %17 %16 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
38
test_conformance/spirv_new/spirv_asm/spv1.1/basic.spvasm64
Normal file
38
test_conformance/spirv_new/spirv_asm/spv1.1/basic.spvasm64
Normal file
@@ -0,0 +1,38 @@
|
||||
; SPIR-V
|
||||
; Version: 1.1
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 22
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %10 "test_basic" %gl_GlobalInvocationID
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
%ulong = OpTypeInt 64 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3ulong = OpTypeVector %ulong 3
|
||||
%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input
|
||||
%10 = OpFunction %void None %9
|
||||
%11 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%12 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%13 = OpLabel
|
||||
%14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 32
|
||||
%15 = OpCompositeExtract %ulong %14 0
|
||||
%16 = OpUConvert %uint %15
|
||||
%17 = OpSConvert %ulong %16
|
||||
%18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %12 %17
|
||||
%19 = OpLoad %uint %18 Aligned 4
|
||||
%20 = OpSConvert %ulong %16
|
||||
%21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %11 %20
|
||||
OpStore %21 %19 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
33
test_conformance/spirv_new/spirv_asm/spv1.2/basic.spvasm32
Normal file
33
test_conformance/spirv_new/spirv_asm/spv1.2/basic.spvasm32
Normal file
@@ -0,0 +1,33 @@
|
||||
; SPIR-V
|
||||
; Version: 1.2
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 18
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %9 "test_basic" %gl_GlobalInvocationID
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
|
||||
%9 = OpFunction %void None %8
|
||||
%10 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%11 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%12 = OpLabel
|
||||
%13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 16
|
||||
%14 = OpCompositeExtract %uint %13 0
|
||||
%15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %11 %14
|
||||
%16 = OpLoad %uint %15 Aligned 4
|
||||
%17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %10 %14
|
||||
OpStore %17 %16 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
38
test_conformance/spirv_new/spirv_asm/spv1.2/basic.spvasm64
Normal file
38
test_conformance/spirv_new/spirv_asm/spv1.2/basic.spvasm64
Normal file
@@ -0,0 +1,38 @@
|
||||
; SPIR-V
|
||||
; Version: 1.2
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 22
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %10 "test_basic" %gl_GlobalInvocationID
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
%ulong = OpTypeInt 64 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3ulong = OpTypeVector %ulong 3
|
||||
%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input
|
||||
%10 = OpFunction %void None %9
|
||||
%11 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%12 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%13 = OpLabel
|
||||
%14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 32
|
||||
%15 = OpCompositeExtract %ulong %14 0
|
||||
%16 = OpUConvert %uint %15
|
||||
%17 = OpSConvert %ulong %16
|
||||
%18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %12 %17
|
||||
%19 = OpLoad %uint %18 Aligned 4
|
||||
%20 = OpSConvert %ulong %16
|
||||
%21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %11 %20
|
||||
OpStore %21 %19 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
33
test_conformance/spirv_new/spirv_asm/spv1.3/basic.spvasm32
Normal file
33
test_conformance/spirv_new/spirv_asm/spv1.3/basic.spvasm32
Normal file
@@ -0,0 +1,33 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 18
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %9 "test_basic" %gl_GlobalInvocationID
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
|
||||
%9 = OpFunction %void None %8
|
||||
%10 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%11 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%12 = OpLabel
|
||||
%13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 16
|
||||
%14 = OpCompositeExtract %uint %13 0
|
||||
%15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %11 %14
|
||||
%16 = OpLoad %uint %15 Aligned 4
|
||||
%17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %10 %14
|
||||
OpStore %17 %16 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
38
test_conformance/spirv_new/spirv_asm/spv1.3/basic.spvasm64
Normal file
38
test_conformance/spirv_new/spirv_asm/spv1.3/basic.spvasm64
Normal file
@@ -0,0 +1,38 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 22
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %10 "test_basic" %gl_GlobalInvocationID
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
%ulong = OpTypeInt 64 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3ulong = OpTypeVector %ulong 3
|
||||
%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input
|
||||
%10 = OpFunction %void None %9
|
||||
%11 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%12 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%13 = OpLabel
|
||||
%14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 32
|
||||
%15 = OpCompositeExtract %ulong %14 0
|
||||
%16 = OpUConvert %uint %15
|
||||
%17 = OpSConvert %ulong %16
|
||||
%18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %12 %17
|
||||
%19 = OpLoad %uint %18 Aligned 4
|
||||
%20 = OpSConvert %ulong %16
|
||||
%21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %11 %20
|
||||
OpStore %21 %19 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
33
test_conformance/spirv_new/spirv_asm/spv1.4/basic.spvasm32
Normal file
33
test_conformance/spirv_new/spirv_asm/spv1.4/basic.spvasm32
Normal file
@@ -0,0 +1,33 @@
|
||||
; SPIR-V
|
||||
; Version: 1.4
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 18
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %9 "test_basic" %gl_GlobalInvocationID
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
|
||||
%9 = OpFunction %void None %8
|
||||
%10 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%11 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%12 = OpLabel
|
||||
%13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 16
|
||||
%14 = OpCompositeExtract %uint %13 0
|
||||
%15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %11 %14
|
||||
%16 = OpLoad %uint %15 Aligned 4
|
||||
%17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %10 %14
|
||||
OpStore %17 %16 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
38
test_conformance/spirv_new/spirv_asm/spv1.4/basic.spvasm64
Normal file
38
test_conformance/spirv_new/spirv_asm/spv1.4/basic.spvasm64
Normal file
@@ -0,0 +1,38 @@
|
||||
; SPIR-V
|
||||
; Version: 1.4
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 22
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %10 "test_basic" %gl_GlobalInvocationID
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
%ulong = OpTypeInt 64 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3ulong = OpTypeVector %ulong 3
|
||||
%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input
|
||||
%10 = OpFunction %void None %9
|
||||
%11 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%12 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%13 = OpLabel
|
||||
%14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 32
|
||||
%15 = OpCompositeExtract %ulong %14 0
|
||||
%16 = OpUConvert %uint %15
|
||||
%17 = OpSConvert %ulong %16
|
||||
%18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %12 %17
|
||||
%19 = OpLoad %uint %18 Aligned 4
|
||||
%20 = OpSConvert %ulong %16
|
||||
%21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %11 %20
|
||||
OpStore %21 %19 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
33
test_conformance/spirv_new/spirv_asm/spv1.5/basic.spvasm32
Normal file
33
test_conformance/spirv_new/spirv_asm/spv1.5/basic.spvasm32
Normal file
@@ -0,0 +1,33 @@
|
||||
; SPIR-V
|
||||
; Version: 1.5
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 18
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %9 "test_basic" %gl_GlobalInvocationID
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
|
||||
%9 = OpFunction %void None %8
|
||||
%10 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%11 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%12 = OpLabel
|
||||
%13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 16
|
||||
%14 = OpCompositeExtract %uint %13 0
|
||||
%15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %11 %14
|
||||
%16 = OpLoad %uint %15 Aligned 4
|
||||
%17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %10 %14
|
||||
OpStore %17 %16 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
38
test_conformance/spirv_new/spirv_asm/spv1.5/basic.spvasm64
Normal file
38
test_conformance/spirv_new/spirv_asm/spv1.5/basic.spvasm64
Normal file
@@ -0,0 +1,38 @@
|
||||
; SPIR-V
|
||||
; Version: 1.5
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 22
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %10 "test_basic" %gl_GlobalInvocationID
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
%ulong = OpTypeInt 64 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3ulong = OpTypeVector %ulong 3
|
||||
%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input
|
||||
%10 = OpFunction %void None %9
|
||||
%11 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%12 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%13 = OpLabel
|
||||
%14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 32
|
||||
%15 = OpCompositeExtract %ulong %14 0
|
||||
%16 = OpUConvert %uint %15
|
||||
%17 = OpSConvert %ulong %16
|
||||
%18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %12 %17
|
||||
%19 = OpLoad %uint %18 Aligned 4
|
||||
%20 = OpSConvert %ulong %16
|
||||
%21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %11 %20
|
||||
OpStore %21 %19 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
33
test_conformance/spirv_new/spirv_asm/spv1.6/basic.spvasm32
Normal file
33
test_conformance/spirv_new/spirv_asm/spv1.6/basic.spvasm32
Normal file
@@ -0,0 +1,33 @@
|
||||
; SPIR-V
|
||||
; Version: 1.6
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 18
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical32 OpenCL
|
||||
OpEntryPoint Kernel %9 "test_basic" %gl_GlobalInvocationID
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%8 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
|
||||
%9 = OpFunction %void None %8
|
||||
%10 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%11 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%12 = OpLabel
|
||||
%13 = OpLoad %v3uint %gl_GlobalInvocationID Aligned 16
|
||||
%14 = OpCompositeExtract %uint %13 0
|
||||
%15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %11 %14
|
||||
%16 = OpLoad %uint %15 Aligned 4
|
||||
%17 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %10 %14
|
||||
OpStore %17 %16 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
38
test_conformance/spirv_new/spirv_asm/spv1.6/basic.spvasm64
Normal file
38
test_conformance/spirv_new/spirv_asm/spv1.6/basic.spvasm64
Normal file
@@ -0,0 +1,38 @@
|
||||
; SPIR-V
|
||||
; Version: 1.6
|
||||
; Generator: Khronos LLVM/SPIR-V Translator; 14
|
||||
; Bound: 22
|
||||
; Schema: 0
|
||||
OpCapability Addresses
|
||||
OpCapability Linkage
|
||||
OpCapability Kernel
|
||||
OpCapability Int64
|
||||
%1 = OpExtInstImport "OpenCL.std"
|
||||
OpMemoryModel Physical64 OpenCL
|
||||
OpEntryPoint Kernel %10 "test_basic" %gl_GlobalInvocationID
|
||||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
||||
OpDecorate %gl_GlobalInvocationID Constant
|
||||
OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import
|
||||
%ulong = OpTypeInt 64 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3ulong = OpTypeVector %ulong 3
|
||||
%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong
|
||||
%void = OpTypeVoid
|
||||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
|
||||
%9 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
|
||||
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input
|
||||
%10 = OpFunction %void None %9
|
||||
%11 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%12 = OpFunctionParameter %_ptr_CrossWorkgroup_uint
|
||||
%13 = OpLabel
|
||||
%14 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 32
|
||||
%15 = OpCompositeExtract %ulong %14 0
|
||||
%16 = OpUConvert %uint %15
|
||||
%17 = OpSConvert %ulong %16
|
||||
%18 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %12 %17
|
||||
%19 = OpLoad %uint %18 Aligned 4
|
||||
%20 = OpSConvert %ulong %16
|
||||
%21 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %11 %20
|
||||
OpStore %21 %19 Aligned 4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -1,15 +1,19 @@
|
||||
/******************************************************************
|
||||
Copyright (c) 2016 The Khronos Group Inc. All Rights Reserved.
|
||||
//
|
||||
// Copyright (c) 2016-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
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
|
||||
|
||||
#ifndef _testBase_h
|
||||
|
||||
123
test_conformance/spirv_new/test_basic_versions.cpp
Normal file
123
test_conformance/spirv_new/test_basic_versions.cpp
Normal file
@@ -0,0 +1,123 @@
|
||||
//
|
||||
// Copyright (c) 2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "testBase.h"
|
||||
#include "types.hpp"
|
||||
|
||||
#include <map>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
extern bool gVersionSkip;
|
||||
|
||||
TEST_SPIRV_FUNC(basic_versions)
|
||||
{
|
||||
cl_int error = CL_SUCCESS;
|
||||
|
||||
MTdataHolder d(gRandomSeed);
|
||||
|
||||
std::vector<cl_int> h_src(num_elements);
|
||||
generate_random_data(kInt, h_src.size(), d, h_src.data());
|
||||
|
||||
clMemWrapper src =
|
||||
clCreateBuffer(context, CL_MEM_COPY_HOST_PTR,
|
||||
h_src.size() * sizeof(cl_int), h_src.data(), &error);
|
||||
test_error(error, "Unable to create source buffer");
|
||||
|
||||
clMemWrapper dst =
|
||||
clCreateBuffer(context, 0, h_src.size() * sizeof(cl_int), NULL, &error);
|
||||
test_error(error, "Unable to create destination buffer");
|
||||
|
||||
std::map<std::string, std::string> mapILtoSubdir({
|
||||
{ "SPIR-V_1.0", "" }, // SPIR-V 1.0 files are in the base directory
|
||||
{ "SPIR-V_1.1", "spv1.1" },
|
||||
{ "SPIR-V_1.2", "spv1.2" },
|
||||
{ "SPIR-V_1.3", "spv1.3" },
|
||||
{ "SPIR-V_1.4", "spv1.4" },
|
||||
{ "SPIR-V_1.5", "spv1.5" },
|
||||
{ "SPIR-V_1.6", "spv1.6" },
|
||||
});
|
||||
|
||||
size_t sz = 0;
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_IL_VERSION, 0, NULL, &sz);
|
||||
test_error(error, "Unable to query device IL versions size");
|
||||
|
||||
std::string ilVersions;
|
||||
ilVersions.resize(sz);
|
||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_IL_VERSION, sz, &ilVersions[0],
|
||||
NULL);
|
||||
test_error(error, "Unable to query device IL versions string");
|
||||
|
||||
for (auto& testCase : mapILtoSubdir)
|
||||
{
|
||||
if (gVersionSkip)
|
||||
{
|
||||
log_info(" Skipping version check for %s.\n",
|
||||
testCase.first.c_str());
|
||||
}
|
||||
else if (ilVersions.find(testCase.first) == std::string::npos)
|
||||
{
|
||||
log_info(" Version %s is not supported; skipping test.\n",
|
||||
testCase.first.c_str());
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
log_info(" testing %s...\n", testCase.first.c_str());
|
||||
}
|
||||
|
||||
const cl_int zero = 0;
|
||||
error =
|
||||
clEnqueueFillBuffer(queue, dst, &zero, sizeof(zero), 0,
|
||||
h_src.size() * sizeof(cl_int), 0, NULL, NULL);
|
||||
test_error(error, "Unable to initialize destination buffer");
|
||||
|
||||
std::string filename = testCase.second + "/basic";
|
||||
|
||||
clProgramWrapper prog;
|
||||
error = get_program_with_il(prog, deviceID, context, filename.c_str());
|
||||
test_error(error, "Unable to build SPIR-V program");
|
||||
|
||||
clKernelWrapper kernel = clCreateKernel(prog, "test_basic", &error);
|
||||
test_error(error, "Unable to create SPIR-V kernel");
|
||||
|
||||
error |= clSetKernelArg(kernel, 0, sizeof(dst), &dst);
|
||||
error |= clSetKernelArg(kernel, 1, sizeof(src), &src);
|
||||
test_error(error, "Unable to set kernel arguments");
|
||||
|
||||
size_t global = num_elements;
|
||||
error = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0,
|
||||
NULL, NULL);
|
||||
test_error(error, "Unable to enqueue kernel");
|
||||
|
||||
std::vector<cl_int> h_dst(num_elements);
|
||||
error = clEnqueueReadBuffer(queue, dst, CL_TRUE, 0,
|
||||
h_dst.size() * sizeof(cl_int), h_dst.data(),
|
||||
0, NULL, NULL);
|
||||
test_error(error, "Unable to read destination buffer");
|
||||
|
||||
for (int i = 0; i < num_elements; i++)
|
||||
{
|
||||
if (h_dst[i] != h_src[i])
|
||||
{
|
||||
log_error("Values do not match at location %d\n", i);
|
||||
return TEST_FAIL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TEST_PASS;
|
||||
}
|
||||
@@ -1,15 +1,18 @@
|
||||
/******************************************************************
|
||||
Copyright (c) 2018 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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2018-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "testBase.h"
|
||||
#include "types.hpp"
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
/******************************************************************
|
||||
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 h_in whole or h_in part to
|
||||
third parties, and may not be reproduced, republished, distributed, transmitted, displayed,
|
||||
broadcast or otherwise exploited h_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,
|
||||
h_in whole or h_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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2016-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "testBase.h"
|
||||
#include "types.hpp"
|
||||
@@ -19,10 +22,7 @@ or Khronos Conformance Test Source License Agreement as executed between Khronos
|
||||
#include <limits>
|
||||
#include <cmath>
|
||||
|
||||
#ifndef isnan
|
||||
// Ensure isnan is always present as a macro
|
||||
#define isnan std::isnan
|
||||
#endif
|
||||
#include <CL/cl_half.h>
|
||||
|
||||
long double reference_remainderl(long double x, long double y);
|
||||
int gIsInRTZMode = 0;
|
||||
@@ -30,7 +30,6 @@ int gDeviceILogb0 = 1;
|
||||
int gDeviceILogbNaN = 1;
|
||||
int gCheckTininessBeforeRounding = 1;
|
||||
|
||||
|
||||
static int verify_results(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
@@ -44,7 +43,8 @@ static int verify_results(cl_device_id deviceID,
|
||||
cl_int err = 0;
|
||||
|
||||
RandomSeed seed(gRandomSeed);
|
||||
for (int i = 0; i < num; i++) {
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
h_lhs[i] = genrand<cl_int>(seed);
|
||||
h_rhs[i] = genrand<cl_int>(seed);
|
||||
}
|
||||
@@ -86,8 +86,10 @@ static int verify_results(cl_device_id deviceID,
|
||||
err = clEnqueueReadBuffer(queue, res, CL_TRUE, 0, bytes, &h_res[0], 0, NULL, NULL);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to read to output");
|
||||
|
||||
for (int i = 0; i < num; i++) {
|
||||
if (h_res[i] != (h_lhs[i] + h_rhs[i])) {
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
if (h_res[i] != (h_lhs[i] + h_rhs[i]))
|
||||
{
|
||||
log_error("Values do not match at location %d\n", i);
|
||||
return -1;
|
||||
}
|
||||
@@ -132,12 +134,10 @@ TEST_SPIRV_FUNC(decorate_constant)
|
||||
|
||||
TEST_SPIRV_FUNC(decorate_cpacked)
|
||||
{
|
||||
PACKED(
|
||||
struct packed_struct_t {
|
||||
cl_int ival;
|
||||
cl_char cval;
|
||||
}
|
||||
);
|
||||
PACKED(struct packed_struct_t {
|
||||
cl_int ival;
|
||||
cl_char cval;
|
||||
});
|
||||
|
||||
typedef struct packed_struct_t packed_t;
|
||||
|
||||
@@ -166,9 +166,10 @@ TEST_SPIRV_FUNC(decorate_cpacked)
|
||||
err = clEnqueueReadBuffer(queue, res, CL_TRUE, 0, bytes, &h_res[0], 0, NULL, NULL);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to read to output");
|
||||
|
||||
for (int i = 0; i < num; i++) {
|
||||
if (h_res[i].ival != 2100483600 ||
|
||||
h_res[i].cval != 127) {
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
if (h_res[i].ival != 2100483600 || h_res[i].cval != 127)
|
||||
{
|
||||
log_error("Values do not match at location %d\n", i);
|
||||
return -1;
|
||||
}
|
||||
@@ -177,20 +178,79 @@ TEST_SPIRV_FUNC(decorate_cpacked)
|
||||
return 0;
|
||||
}
|
||||
|
||||
template<typename Ti, typename Tl, typename To>
|
||||
int verify_saturated_results(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
const char *kname,
|
||||
const clProgramWrapper &prog)
|
||||
template <typename Ti, typename Tl, typename To>
|
||||
static inline Ti generate_saturated_lhs_input(RandomSeed &seed)
|
||||
{
|
||||
if(std::string(kname).find("double") != std::string::npos) {
|
||||
if(!is_extension_available(deviceID, "cl_khr_fp64")) {
|
||||
log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n");
|
||||
return 0;
|
||||
}
|
||||
constexpr auto loVal = std::numeric_limits<To>::min();
|
||||
constexpr auto hiVal = std::numeric_limits<To>::max();
|
||||
constexpr Tl range = (Tl)(hiVal) - (Tl)(loVal);
|
||||
|
||||
if (std::is_same<cl_half, Ti>::value)
|
||||
{
|
||||
return cl_half_from_float(genrand<float>(seed) * range, CL_HALF_RTE);
|
||||
}
|
||||
|
||||
return genrand<Ti>(seed) * range;
|
||||
}
|
||||
|
||||
template <typename Ti, typename Tl, typename To>
|
||||
static inline Ti generate_saturated_rhs_input(RandomSeed &seed)
|
||||
{
|
||||
constexpr auto hiVal = std::numeric_limits<To>::max();
|
||||
|
||||
Tl val = genrand<Tl>(seed) % hiVal;
|
||||
if (std::is_same<cl_half, Ti>::value)
|
||||
{
|
||||
if (val > 0 && val * 20 < hiVal)
|
||||
{
|
||||
return cl_half_from_float(NAN, CL_HALF_RTE);
|
||||
}
|
||||
return cl_half_from_float(val, CL_HALF_RTE);
|
||||
}
|
||||
|
||||
if (val > 0 && val * 20 < hiVal)
|
||||
{
|
||||
return (Ti)NAN;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
template <typename Ti, typename Tl, typename To>
|
||||
static inline To compute_saturated_output(Ti lhs, Ti rhs)
|
||||
{
|
||||
constexpr auto loVal = std::numeric_limits<To>::min();
|
||||
constexpr auto hiVal = std::numeric_limits<To>::max();
|
||||
|
||||
if (std::is_same<Ti, cl_half>::value)
|
||||
{
|
||||
cl_float f = cl_half_to_float(lhs) * cl_half_to_float(rhs);
|
||||
|
||||
// Quantize to fp16:
|
||||
f = cl_half_to_float(cl_half_from_float(f, CL_HALF_RTE));
|
||||
|
||||
To val = (To)std::min<float>(std::max<float>(f, loVal), hiVal);
|
||||
if (isnan(cl_half_from_float(rhs, CL_HALF_RTE)))
|
||||
{
|
||||
val = 0;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
Tl ival = (Tl)(lhs * rhs);
|
||||
To val = (To)std::min<Ti>(std::max<Ti>(ival, loVal), hiVal);
|
||||
|
||||
if (isnan(rhs))
|
||||
{
|
||||
val = 0;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
template <typename Ti, typename Tl, typename To>
|
||||
int verify_saturated_results(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, const char *kname,
|
||||
const clProgramWrapper &prog)
|
||||
{
|
||||
cl_int err = 0;
|
||||
|
||||
const int num = 1 << 20;
|
||||
@@ -204,21 +264,11 @@ int verify_saturated_results(cl_device_id deviceID,
|
||||
std::vector<Ti> h_lhs(num);
|
||||
std::vector<Ti> h_rhs(num);
|
||||
|
||||
To loVal = std::numeric_limits<To>::min();
|
||||
To hiVal = std::numeric_limits<To>::max();
|
||||
|
||||
Tl range = (Tl)(hiVal) - (Tl)(loVal);
|
||||
|
||||
RandomSeed seed(gRandomSeed);
|
||||
for (int i = 0; i < num; i++) {
|
||||
h_lhs[i] = genrand<Ti>(seed) * range;
|
||||
Tl val = (genrand<Tl>(seed) % hiVal);
|
||||
// randomly set some values on rhs to NaN
|
||||
if (val * 20 < hiVal) {
|
||||
h_rhs[i] = NAN;
|
||||
} else {
|
||||
h_rhs[i] = (Ti)(val);
|
||||
}
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
h_lhs[i] = generate_saturated_lhs_input<Ti, Tl, To>(seed);
|
||||
h_rhs[i] = generate_saturated_rhs_input<Ti, Tl, To>(seed);
|
||||
}
|
||||
|
||||
clMemWrapper lhs = clCreateBuffer(context, CL_MEM_READ_ONLY, in_bytes, NULL, &err);
|
||||
@@ -253,16 +303,13 @@ int verify_saturated_results(cl_device_id deviceID,
|
||||
err = clEnqueueReadBuffer(queue, res, CL_TRUE, 0, out_bytes, &h_res[0], 0, NULL, NULL);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to read to output");
|
||||
|
||||
for (int i = 0; i < num; i++) {
|
||||
Tl ival = (Tl)(h_lhs[i] * h_rhs[i]);
|
||||
To val = (To)std::min<Ti>(std::max<Ti>(ival, loVal), hiVal);
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
To val = compute_saturated_output<Ti, Tl, To>(h_lhs[i], h_rhs[i]);
|
||||
|
||||
if (isnan(h_rhs[i])) {
|
||||
val = 0;
|
||||
}
|
||||
|
||||
if (val != h_res[i]) {
|
||||
log_error("Value error at %d\n", i);
|
||||
if (val != h_res[i])
|
||||
{
|
||||
log_error("Value error at %d: got %d, want %d\n", i, val, h_res[i]);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -278,31 +325,47 @@ int test_saturate_full(cl_device_id deviceID,
|
||||
const char *name,
|
||||
const char *types)
|
||||
{
|
||||
if(std::string(types).find("double") != std::string::npos) {
|
||||
if(!is_extension_available(deviceID, "cl_khr_fp64")) {
|
||||
log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n");
|
||||
if (std::string(types).find("double") != std::string::npos)
|
||||
{
|
||||
if (!is_extension_available(deviceID, "cl_khr_fp64"))
|
||||
{
|
||||
log_info("Extension cl_khr_fp64 not supported; skipping double "
|
||||
"tests.\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (std::string(types).find("half") != std::string::npos)
|
||||
{
|
||||
if (!is_extension_available(deviceID, "cl_khr_fp16"))
|
||||
{
|
||||
log_info(
|
||||
"Extension cl_khr_fp16 not supported; skipping half tests.\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
clProgramWrapper prog;
|
||||
cl_int err = 0;
|
||||
err = get_program_with_il(prog, deviceID, context, name);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to build program");
|
||||
return verify_saturated_results<Ti, Tl, To>(deviceID, context, queue, name, prog);
|
||||
return verify_saturated_results<Ti, Tl, To>(deviceID, context, queue, name,
|
||||
prog);
|
||||
}
|
||||
|
||||
#define TEST_SATURATED_CONVERSION(Ti, Tl, To) \
|
||||
TEST_SPIRV_FUNC(decorate_saturated_conversion_##To) \
|
||||
{ \
|
||||
typedef cl_##Ti cl_Ti; \
|
||||
typedef cl_##Tl cl_Tl; \
|
||||
typedef cl_##To cl_To; \
|
||||
return test_saturate_full<cl_Ti, cl_Tl, cl_To> \
|
||||
(deviceID, context, queue, \
|
||||
"decorate_saturated_conversion_" #To, \
|
||||
#Ti #Tl #To); \
|
||||
} \
|
||||
#define TEST_SATURATED_CONVERSION(Ti, Tl, To) \
|
||||
TEST_SPIRV_FUNC(decorate_saturated_conversion_##Ti##_to_##To) \
|
||||
{ \
|
||||
typedef cl_##Ti cl_Ti; \
|
||||
typedef cl_##Tl cl_Tl; \
|
||||
typedef cl_##To cl_To; \
|
||||
const char *name = "decorate_saturated_conversion_" #Ti "_to_" #To; \
|
||||
return test_saturate_full<cl_Ti, cl_Tl, cl_To>( \
|
||||
deviceID, context, queue, name, #Ti #Tl #To); \
|
||||
}
|
||||
|
||||
TEST_SATURATED_CONVERSION(half, short, char)
|
||||
TEST_SATURATED_CONVERSION(half, ushort, uchar)
|
||||
TEST_SATURATED_CONVERSION(float, int, char)
|
||||
TEST_SATURATED_CONVERSION(float, uint, uchar)
|
||||
TEST_SATURATED_CONVERSION(float, int, short)
|
||||
@@ -318,13 +381,26 @@ int test_fp_rounding(cl_device_id deviceID,
|
||||
std::vector<Ti> &h_in,
|
||||
std::vector<To> &h_out)
|
||||
{
|
||||
if(std::string(name).find("double") != std::string::npos) {
|
||||
if(!is_extension_available(deviceID, "cl_khr_fp64")) {
|
||||
log_info("Extension cl_khr_fp64 not supported; skipping double tests.\n");
|
||||
if (std::string(name).find("double") != std::string::npos)
|
||||
{
|
||||
if (!is_extension_available(deviceID, "cl_khr_fp64"))
|
||||
{
|
||||
log_info("Extension cl_khr_fp64 not supported; skipping double "
|
||||
"tests.\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (std::string(name).find("half") != std::string::npos)
|
||||
{
|
||||
if (!is_extension_available(deviceID, "cl_khr_fp16"))
|
||||
{
|
||||
log_info(
|
||||
"Extension cl_khr_fp16 not supported; skipping half tests.\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
const int num = h_in.size();
|
||||
const size_t in_bytes = num * sizeof(Ti);
|
||||
const size_t out_bytes = num * sizeof(To);
|
||||
@@ -359,9 +435,12 @@ int test_fp_rounding(cl_device_id deviceID,
|
||||
err = clEnqueueReadBuffer(queue, out, CL_TRUE, 0, out_bytes, &h_res[0], 0, NULL, NULL);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to read from output");
|
||||
|
||||
for (int i = 0; i < num; i++) {
|
||||
if (h_res[i] != h_out[i]) {
|
||||
log_error("Values do not match at location %d. Original :%lf, Expected: %ld, Found %ld\n",
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
if (h_res[i] != h_out[i])
|
||||
{
|
||||
log_error("Values do not match at location %d. Original :%lf, "
|
||||
"Expected: %ld, Found %ld\n",
|
||||
i, h_in[i], h_out[i], h_res[i]);
|
||||
return -1;
|
||||
}
|
||||
@@ -370,60 +449,80 @@ int test_fp_rounding(cl_device_id deviceID,
|
||||
return 0;
|
||||
}
|
||||
|
||||
template<typename Ti, typename To>
|
||||
inline To round_to_zero(Ti in)
|
||||
template <typename T> static inline double to_double(T in) { return in; }
|
||||
|
||||
template <> inline double to_double(cl_half in) { return cl_half_to_float(in); }
|
||||
|
||||
template <typename Ti, typename To> static inline To round_to_zero(Ti in)
|
||||
{
|
||||
To out = (To)(in);
|
||||
return out;
|
||||
return (To)to_double(in);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
int sign(T val)
|
||||
template <typename T> static inline int sign(T val)
|
||||
{
|
||||
if (val < 0) return -1;
|
||||
if (val > 0) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
template<typename Ti, typename To>
|
||||
inline To round_to_even(Ti in)
|
||||
template <typename Ti, typename To> static inline To round_to_even(Ti in)
|
||||
{
|
||||
// https://en.wikipedia.org/wiki/Rounding#Round_half_to_even
|
||||
return std::floor(in + 0.5) - 1 + std::abs(sign(reference_remainderl((long double)in, 2) - 0.5));
|
||||
double din = to_double(in);
|
||||
return std::floor(din + 0.5) - 1
|
||||
+ std::abs(sign(reference_remainderl((long double)din, 2) - 0.5));
|
||||
}
|
||||
|
||||
template<typename Ti, typename To>
|
||||
inline To round_to_posinf(Ti in)
|
||||
template <typename Ti, typename To> static inline To round_to_posinf(Ti in)
|
||||
{
|
||||
To out = std::ceil(in);
|
||||
return out;
|
||||
return std::ceil(to_double(in));
|
||||
}
|
||||
|
||||
template<typename Ti, typename To>
|
||||
inline To round_to_neginf(Ti in)
|
||||
template <typename Ti, typename To> static inline To round_to_neginf(Ti in)
|
||||
{
|
||||
To out = std::floor(in);
|
||||
return out;
|
||||
return std::floor(to_double(in));
|
||||
}
|
||||
|
||||
#define TEST_SPIRV_FP_ROUNDING_DECORATE(name, func, Ti, To) \
|
||||
TEST_SPIRV_FUNC(decorate_fp_rounding_mode_##name##_##Ti##_##To) \
|
||||
{ \
|
||||
typedef cl_##Ti clTi; \
|
||||
typedef cl_##To clTo; \
|
||||
const int num = 1 << 16; \
|
||||
std::vector<clTi> in(num); \
|
||||
std::vector<clTo> out(num); \
|
||||
RandomSeed seed(gRandomSeed); \
|
||||
\
|
||||
for (int i = 0; i < num; i++) { \
|
||||
in[i] = num * genrand<clTi>(seed) - num/2; \
|
||||
out[i] = func<clTi, clTo>(in[i]); \
|
||||
} \
|
||||
const char *name = "decorate_rounding_" #name "_" #Ti "_" #To; \
|
||||
return test_fp_rounding(deviceID, context, queue, \
|
||||
name, in, out); \
|
||||
} \
|
||||
template <typename Ti, typename To>
|
||||
static inline Ti generate_fprounding_input(RandomSeed &seed)
|
||||
{
|
||||
if (std::is_same<cl_half, Ti>::value)
|
||||
{
|
||||
constexpr auto minVal =
|
||||
static_cast<cl_float>(std::numeric_limits<To>::min() / 2);
|
||||
constexpr auto maxVal =
|
||||
static_cast<cl_float>(std::numeric_limits<To>::max() / 2);
|
||||
cl_float f = genrandReal_range<cl_float>(minVal, maxVal, seed);
|
||||
return cl_half_from_float(f, CL_HALF_RTE);
|
||||
}
|
||||
|
||||
constexpr auto minVal = static_cast<Ti>(std::numeric_limits<To>::min() / 2);
|
||||
constexpr auto maxVal = static_cast<Ti>(std::numeric_limits<To>::max() / 2);
|
||||
return genrandReal_range<Ti>(minVal, maxVal, seed);
|
||||
}
|
||||
|
||||
#define TEST_SPIRV_FP_ROUNDING_DECORATE(name, func, Ti, To) \
|
||||
TEST_SPIRV_FUNC(decorate_fp_rounding_mode_##name##_##Ti##_##To) \
|
||||
{ \
|
||||
typedef cl_##Ti clTi; \
|
||||
typedef cl_##To clTo; \
|
||||
const int num = 1 << 16; \
|
||||
std::vector<clTi> in(num); \
|
||||
std::vector<clTo> out(num); \
|
||||
RandomSeed seed(gRandomSeed); \
|
||||
\
|
||||
for (int i = 0; i < num; i++) \
|
||||
{ \
|
||||
in[i] = generate_fprounding_input<clTi, clTo>(seed); \
|
||||
out[i] = func<clTi, clTo>(in[i]); \
|
||||
} \
|
||||
const char *name = "decorate_rounding_" #name "_" #Ti "_" #To; \
|
||||
return test_fp_rounding(deviceID, context, queue, name, in, out); \
|
||||
}
|
||||
|
||||
TEST_SPIRV_FP_ROUNDING_DECORATE(rte, round_to_even, half, short);
|
||||
TEST_SPIRV_FP_ROUNDING_DECORATE(rtz, round_to_zero, half, short);
|
||||
TEST_SPIRV_FP_ROUNDING_DECORATE(rtp, round_to_posinf, half, short);
|
||||
TEST_SPIRV_FP_ROUNDING_DECORATE(rtn, round_to_neginf, half, short);
|
||||
|
||||
TEST_SPIRV_FP_ROUNDING_DECORATE(rte, round_to_even, float, int);
|
||||
TEST_SPIRV_FP_ROUNDING_DECORATE(rtz, round_to_zero, float, int);
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
/******************************************************************
|
||||
Copyright (c) 2020 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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2020-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "testBase.h"
|
||||
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
/******************************************************************
|
||||
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 h_in whole or h_in part to
|
||||
third parties, and may not be reproduced, republished, distributed, transmitted, displayed,
|
||||
broadcast or otherwise exploited h_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,
|
||||
h_in whole or h_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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2016-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "testBase.h"
|
||||
#include "types.hpp"
|
||||
@@ -141,3 +144,96 @@ TEST_SPIRV_FUNC(linkage_import_function_link)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int test_linkonce_odr_helper(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue,
|
||||
const char *main_module_filename)
|
||||
{
|
||||
cl_int err = 0;
|
||||
|
||||
clProgramWrapper prog_obj;
|
||||
err = test_linkage_compile(deviceID, context, queue,
|
||||
"linkage_linkonce_odr_obj", prog_obj);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to compile export program");
|
||||
|
||||
clProgramWrapper prog_main;
|
||||
err = test_linkage_compile(deviceID, context, queue, main_module_filename,
|
||||
prog_main);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to compile import program");
|
||||
|
||||
cl_program progs[] = { prog_obj, prog_main };
|
||||
|
||||
clProgramWrapper prog =
|
||||
clLinkProgram(context, 1, &deviceID, NULL, 2, progs, NULL, NULL, &err);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to link programs");
|
||||
|
||||
clKernelWrapper kernel = clCreateKernel(prog, "test_linkonce_odr", &err);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to create spv kernel");
|
||||
|
||||
const int num = 256;
|
||||
std::vector<cl_int> h_in(num);
|
||||
RandomSeed seed(gRandomSeed);
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
h_in[i] = genrand<cl_int>(seed) % 2048;
|
||||
}
|
||||
|
||||
size_t bytes = sizeof(cl_int) * num;
|
||||
clMemWrapper in =
|
||||
clCreateBuffer(context, CL_MEM_READ_WRITE, bytes, NULL, &err);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to create in buffer");
|
||||
|
||||
err = clEnqueueWriteBuffer(queue, in, CL_TRUE, 0, bytes, &h_in[0], 0, NULL,
|
||||
NULL);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to copy to in buffer");
|
||||
|
||||
err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &in);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to set arg 1");
|
||||
|
||||
size_t global = num;
|
||||
err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global, NULL, 0, NULL,
|
||||
NULL);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to enqueue cl kernel");
|
||||
|
||||
std::vector<cl_int> h_out(num);
|
||||
err = clEnqueueReadBuffer(queue, in, CL_TRUE, 0, bytes, &h_out[0], 0, NULL,
|
||||
NULL);
|
||||
SPIRV_CHECK_ERROR(err, "Failed to read to output");
|
||||
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
if (h_out[i] != 5)
|
||||
{
|
||||
log_error("Incorrect values at location %d\n", i);
|
||||
return TEST_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return TEST_PASS;
|
||||
}
|
||||
|
||||
TEST_SPIRV_FUNC(linkage_linkonce_odr)
|
||||
{
|
||||
if (!is_extension_available(deviceID, "cl_khr_spirv_linkonce_odr"))
|
||||
{
|
||||
log_info("Extension cl_khr_spirv_linkonce_odr not supported; skipping "
|
||||
"tests.\n");
|
||||
return TEST_SKIPPED_ITSELF;
|
||||
}
|
||||
|
||||
int result = TEST_PASS;
|
||||
|
||||
// For this test, use the default main module, which has an "a" function
|
||||
// with the linkonce_odr linkage type. This ensures that having two "a"
|
||||
// functions with linkonce_odr works properly.
|
||||
result |= test_linkonce_odr_helper(deviceID, context, queue,
|
||||
"linkage_linkonce_odr_main");
|
||||
|
||||
// For this test, use a main module without the "a" function. This ensures
|
||||
// that the "a" function is properly exported with the linkonce_odr linkage
|
||||
// type.
|
||||
result |= test_linkonce_odr_helper(deviceID, context, queue,
|
||||
"linkage_linkonce_odr_noa_main");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
/******************************************************************
|
||||
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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2016-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "testBase.h"
|
||||
#include "types.hpp"
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
/******************************************************************
|
||||
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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2016-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "testBase.h"
|
||||
#include "types.hpp"
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
/******************************************************************
|
||||
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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2016-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "testBase.h"
|
||||
#include "types.hpp"
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
/******************************************************************
|
||||
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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2016-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "testBase.h"
|
||||
#include "types.hpp"
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
/******************************************************************
|
||||
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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2016-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "testBase.h"
|
||||
#include "types.hpp"
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
/******************************************************************
|
||||
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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2016-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "testBase.h"
|
||||
#include "types.hpp"
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
/******************************************************************
|
||||
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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2016-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "testBase.h"
|
||||
#include "types.hpp"
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
/******************************************************************
|
||||
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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2016-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "testBase.h"
|
||||
#include "types.hpp"
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
/******************************************************************
|
||||
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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2016-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "testBase.h"
|
||||
#include "types.hpp"
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
/******************************************************************
|
||||
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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2016-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "testBase.h"
|
||||
#include "types.hpp"
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
/******************************************************************
|
||||
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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2016-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "testBase.h"
|
||||
#include "types.hpp"
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
/******************************************************************
|
||||
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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2016-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "testBase.h"
|
||||
#include "types.hpp"
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
/******************************************************************
|
||||
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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2016-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "testBase.h"
|
||||
#include "types.hpp"
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
/******************************************************************
|
||||
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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2016-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "testBase.h"
|
||||
#include "types.hpp"
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
/******************************************************************
|
||||
Copyright (c) 2020 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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2020-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "testBase.h"
|
||||
#include "types.hpp"
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
/******************************************************************
|
||||
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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2016-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "testBase.h"
|
||||
#include "types.hpp"
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
/******************************************************************
|
||||
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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2016-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "testBase.h"
|
||||
#include "types.hpp"
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
/******************************************************************
|
||||
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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2016-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "testBase.h"
|
||||
#include "types.hpp"
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
/******************************************************************
|
||||
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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2016-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "testBase.h"
|
||||
#include "types.hpp"
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
/******************************************************************
|
||||
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.
|
||||
******************************************************************/
|
||||
//
|
||||
// Copyright (c) 2016-2023 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include <CL/cl.h>
|
||||
@@ -91,6 +94,13 @@ T genrandReal(RandomSeed &seed)
|
||||
return genrand_real1(seed);
|
||||
}
|
||||
|
||||
// Longer-term this could be refactored out and replace random_float():
|
||||
template <typename T> T genrandReal_range(T low, T high, RandomSeed &seed)
|
||||
{
|
||||
T t = genrand_real1(seed);
|
||||
return (1.0 - t) * low + t * high;
|
||||
}
|
||||
|
||||
template<typename T, int N>
|
||||
T genrandRealVec(RandomSeed &seed)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user