Skip to content

Commit

Permalink
Merge branch 'main' into fp16_conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
shajder committed Jun 23, 2023
2 parents f815d9e + df3ec8d commit 87d148b
Show file tree
Hide file tree
Showing 106 changed files with 4,896 additions and 7,576 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ add_definitions(-DCL_USE_DEPRECATED_OPENCL_2_0_APIS=1)
add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_2_APIS=1)
add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_1_APIS=1)
add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_0_APIS=1)
add_definitions(-DCL_NO_EXTENSION_PROTOTYPES)

option(USE_CL_EXPERIMENTAL "Use Experimental definitions" OFF)
if(USE_CL_EXPERIMENTAL)
Expand Down Expand Up @@ -104,8 +105,6 @@ if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?Clang"
add_cxx_flag_if_supported(-Wall)
# Suppress warnings that currently trigger on the code base.
# This list should shrink over time when warnings are fixed.
add_cxx_flag_if_supported(-Wno-unused-but-set-variable)
add_cxx_flag_if_supported(-Wno-sometimes-uninitialized)
add_cxx_flag_if_supported(-Wno-sign-compare)
endif()
add_cxx_flag_if_supported(-Wno-narrowing)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenCL Conformance Test Suite (CTS)

This it the OpenCL CTS for all versions of the Khronos
This is the OpenCL CTS for all versions of the Khronos
[OpenCL](https://www.khronos.org/opencl/) standard.

## Building the CTS
Expand Down Expand Up @@ -89,7 +89,7 @@ require compilation, these are:
## Generating a Conformance Report

The Khronos [Conformance Process Document](https://members.khronos.org/document/dl/911)
details the steps required for a conformance submissions.
details the steps required for a conformance submission.
In this repository [opencl_conformance_tests_full.csv](test_conformance/submission_details_template.txt)
defines the full list of tests which must be run for conformance. The output log
of which must be included alongside a filled in
Expand All @@ -105,7 +105,7 @@ the version of the repository conformance submissions are made against.

Contributions are welcome to the project from Khronos members and non-members
alike via GitHub Pull Requests (PR). Alternatively, if you've found a bug or have
a questions please file an issue in the GitHub project. First time contributors
a question please file an issue in the GitHub project. First time contributors
will be required to sign the Khronos Contributor License Agreement (CLA) before
their PR can be merged.

Expand Down
1 change: 0 additions & 1 deletion presubmit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ cmake .. -G Ninja \
-DBUILD_WSI_XLIB_SUPPORT=OFF \
-DBUILD_WSI_XCB_SUPPORT=OFF \
-DBUILD_WSI_WAYLAND_SUPPORT=OFF \
-DUSE_GAS=OFF \
-C helper.cmake ..
cmake --build . -j2

Expand Down
6 changes: 3 additions & 3 deletions test_common/harness/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef _COMPAT_H_
#define _COMPAT_H_
#ifndef COMPAT_H_
#define COMPAT_H_

#if defined(_WIN32) && defined(_MSC_VER)
#include <Windows.h>
Expand Down Expand Up @@ -398,4 +398,4 @@ EXTERN_C int __builtin_clz(unsigned int pattern);
#define sleep(sec) Sleep((sec)*1000)
#endif

#endif // _COMPAT_H_
#endif // COMPAT_H_
4 changes: 2 additions & 2 deletions test_common/harness/crc32.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Agreement or Khronos Conformance Test Source License Agreement as
executed between Khronos and the recipient.
******************************************************************/

#ifndef _CRC32_H_
#define _CRC32_H_
#ifndef CRC32_H_
#define CRC32_H_

#include <stdint.h>
#include <stddef.h>
Expand Down
10 changes: 0 additions & 10 deletions test_common/harness/imageHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3537,7 +3537,6 @@ void copy_image_data(image_descriptor *srcImageInfo,
{
size_t src_width_lod = 1 /*srcImageInfo->width*/;
size_t src_height_lod = 1 /*srcImageInfo->height*/;
size_t src_depth_lod = 1 /*srcImageInfo->depth*/;

switch (srcImageInfo->type)
{
Expand Down Expand Up @@ -3572,10 +3571,6 @@ void copy_image_data(image_descriptor *srcImageInfo,
src_height_lod = (srcImageInfo->height >> src_lod)
? (srcImageInfo->height >> src_lod)
: 1;
if (srcImageInfo->type == CL_MEM_OBJECT_IMAGE3D)
src_depth_lod = (srcImageInfo->depth >> src_lod)
? (srcImageInfo->depth >> src_lod)
: 1;
break;
}
src_mip_level_offset = compute_mip_level_offset(srcImageInfo, src_lod);
Expand All @@ -3588,7 +3583,6 @@ void copy_image_data(image_descriptor *srcImageInfo,
{
size_t dst_width_lod = 1 /*dstImageInfo->width*/;
size_t dst_height_lod = 1 /*dstImageInfo->height*/;
size_t dst_depth_lod = 1 /*dstImageInfo->depth*/;
switch (dstImageInfo->type)
{
case CL_MEM_OBJECT_IMAGE1D:
Expand Down Expand Up @@ -3622,10 +3616,6 @@ void copy_image_data(image_descriptor *srcImageInfo,
dst_height_lod = (dstImageInfo->height >> dst_lod)
? (dstImageInfo->height >> dst_lod)
: 1;
if (dstImageInfo->type == CL_MEM_OBJECT_IMAGE3D)
dst_depth_lod = (dstImageInfo->depth >> dst_lod)
? (dstImageInfo->depth >> dst_lod)
: 1;
break;
}
dst_mip_level_offset = compute_mip_level_offset(dstImageInfo, dst_lod);
Expand Down
20 changes: 20 additions & 0 deletions test_common/harness/parseParameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ std::string gCompilationCachePath = ".";
std::string gCompilationProgram = DEFAULT_COMPILATION_PROGRAM;
bool gDisableSPIRVValidation = false;
std::string gSPIRVValidator = DEFAULT_SPIRV_VALIDATOR;
unsigned gNumWorkerThreads;

void helpInfo()
{
Expand All @@ -48,6 +49,8 @@ void helpInfo()
online Use online compilation (default)
binary Use binary offline compilation
spir-v Use SPIR-V offline compilation
--num-worker-threads <num>
Select parallel execution with the specified number of worker threads.
For offline compilation (binary and spir-v modes) only:
--compilation-cache-mode <cache-mode>
Expand Down Expand Up @@ -137,6 +140,23 @@ int parseCustomParam(int argc, const char *argv[], const char *ignore)
return -1;
}
}
else if (!strcmp(argv[i], "--num-worker-threads"))
{
delArg++;
if ((i + 1) < argc)
{
delArg++;
const char *numthstr = argv[i + 1];

gNumWorkerThreads = atoi(numthstr);
}
else
{
log_error(
"A parameter to --num-worker-threads must be provided!\n");
return -1;
}
}
else if (!strcmp(argv[i], "--compilation-cache-mode"))
{
delArg++;
Expand Down
41 changes: 41 additions & 0 deletions test_common/harness/stringHelpers.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// 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.
//

#ifndef BASIC_UTILS_H
#define BASIC_UTILS_H

#include <memory>
#include <string>

inline std::string concat_kernel(const char *sstr[], int num)
{
std::string res;
for (int i = 0; i < num; i++) res += std::string(sstr[i]);
return res;
}

template <typename... Args>
inline std::string str_sprintf(const std::string &str, Args... args)
{
int str_size = std::snprintf(nullptr, 0, str.c_str(), args...) + 1;
if (str_size <= 0) throw std::runtime_error("Formatting error.");
size_t s = static_cast<size_t>(str_size);
std::unique_ptr<char[]> buffer(new char[s]);
std::snprintf(buffer.get(), s, str.c_str(), args...);
return std::string(buffer.get(), buffer.get() + s - 1);
}

#endif // BASIC_UTIL_H
Loading

0 comments on commit 87d148b

Please sign in to comment.