Skip to content

Commit

Permalink
Merge branch 'main' into semaphore_negative_clEnqueueSignalSemaphoresKHR
Browse files Browse the repository at this point in the history
  • Loading branch information
shajder committed Sep 4, 2024
2 parents dc72b54 + 9116bb7 commit fa4ea84
Show file tree
Hide file tree
Showing 24 changed files with 1,210 additions and 947 deletions.
29 changes: 13 additions & 16 deletions test_common/harness/kernelHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1511,30 +1511,27 @@ size_t get_min_alignment(cl_context context)
return align_size;
}

cl_device_fp_config get_default_rounding_mode(cl_device_id device,
const cl_uint &param)
cl_device_fp_config get_default_rounding_mode(const cl_device_id device,
const cl_uint param)
{
if (param == CL_DEVICE_DOUBLE_FP_CONFIG)
test_error_ret(
-1,
"FAILURE: CL_DEVICE_DOUBLE_FP_CONFIG not supported by this routine",
0);

char profileStr[128] = "";
cl_device_fp_config single = 0;
int error = clGetDeviceInfo(device, param, sizeof(single), &single, NULL);
cl_device_fp_config config = 0;
int error = clGetDeviceInfo(device, param, sizeof(config), &config, NULL);
if (error)
{
std::string message = std::string("Unable to get device ")
+ std::string(param == CL_DEVICE_HALF_FP_CONFIG
? "CL_DEVICE_HALF_FP_CONFIG"
: "CL_DEVICE_SINGLE_FP_CONFIG");
std::string config_name = "CL_DEVICE_SINGLE_FP_CONFIG";
if (param == CL_DEVICE_HALF_FP_CONFIG)
config_name = "CL_DEVICE_HALF_FP_CONFIG";
else if (param == CL_DEVICE_DOUBLE_FP_CONFIG)
config_name = "CL_DEVICE_DOUBLE_FP_CONFIG";
std::string message =
std::string("Unable to get device ") + config_name;
test_error_ret(error, message.c_str(), 0);
}

if (single & CL_FP_ROUND_TO_NEAREST) return CL_FP_ROUND_TO_NEAREST;
if (config & CL_FP_ROUND_TO_NEAREST) return CL_FP_ROUND_TO_NEAREST;

if (0 == (single & CL_FP_ROUND_TO_ZERO))
if (0 == (config & CL_FP_ROUND_TO_ZERO))
test_error_ret(-1,
"FAILURE: device must support either "
"CL_FP_ROUND_TO_ZERO or CL_FP_ROUND_TO_NEAREST",
Expand Down
4 changes: 2 additions & 2 deletions test_common/harness/kernelHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ size_t get_min_alignment(cl_context context);
/* Helper to obtain the default rounding mode for single precision computation.
* (Double is always CL_FP_ROUND_TO_NEAREST.) Returns 0 on error. */
cl_device_fp_config
get_default_rounding_mode(cl_device_id device,
const cl_uint &param = CL_DEVICE_SINGLE_FP_CONFIG);
get_default_rounding_mode(const cl_device_id device,
const cl_uint param = CL_DEVICE_SINGLE_FP_CONFIG);

#define PASSIVE_REQUIRE_IMAGE_SUPPORT(device) \
if (checkForImageSupport(device)) \
Expand Down
7 changes: 5 additions & 2 deletions test_conformance/api/test_api_consistency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
#include <cinttypes>

#include "testBase.h"
#include "harness/testHarness.h"
#include "harness/deviceInfo.h"
Expand Down Expand Up @@ -158,8 +160,9 @@ static int check_atomic_capabilities(cl_device_atomic_capabilities atomicCaps,
{
if ((atomicCaps & requiredCaps) != requiredCaps)
{
log_error("Atomic capabilities %llx is missing support for at least "
"one required capability %llx!\n",
log_error("Atomic capabilities %" PRIx64
" is missing support for at least "
"one required capability %" PRIx64 "!\n",
atomicCaps, requiredCaps);
return TEST_FAIL;
}
Expand Down
Loading

0 comments on commit fa4ea84

Please sign in to comment.