mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-21 06:49:02 +00:00
Add fp16 testing to conversions and bruteforce (#1975)
Merge the `fp16-staging` branch into `main`, adding fp16 (`half`) testing to the conversions and math bruteforce tests. --------- 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: Marcin Hajder <marcin.hajder@gmail.com> Co-authored-by: Ewan Crawford <ewan@codeplay.com> Co-authored-by: Wawiorko, Grzegorz <grzegorz.wawiorko@intel.com> Co-authored-by: Sreelakshmi Haridas Maruthur <sharidas@quicinc.com> Co-authored-by: Harald van Dijk <harald@gigawatt.nl> Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.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: niranjanjoshi121 <43807392+niranjanjoshi121@users.noreply.github.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: Aharon Abramson <aharon.abramson@mobileye.com>
This commit is contained in:
committed by
GitHub
parent
b3c89ebde0
commit
b6941b6c61
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// Copyright (c) 2022 The Khronos Group Inc.
|
||||
// Copyright (c) 2022-2024 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.
|
||||
@@ -27,8 +27,11 @@ const char *GetTypeName(ParameterType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case ParameterType::Half: return "half";
|
||||
case ParameterType::Float: return "float";
|
||||
case ParameterType::Double: return "double";
|
||||
case ParameterType::Short: return "short";
|
||||
case ParameterType::UShort: return "ushort";
|
||||
case ParameterType::Int: return "int";
|
||||
case ParameterType::UInt: return "uint";
|
||||
case ParameterType::Long: return "long";
|
||||
@@ -41,9 +44,13 @@ const char *GetUndefValue(ParameterType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case ParameterType::Half:
|
||||
case ParameterType::Float:
|
||||
case ParameterType::Double: return "NAN";
|
||||
|
||||
case ParameterType::Short:
|
||||
case ParameterType::UShort: return "0x5678";
|
||||
|
||||
case ParameterType::Int:
|
||||
case ParameterType::UInt: return "0x12345678";
|
||||
|
||||
@@ -71,14 +78,17 @@ void EmitEnableExtension(std::ostringstream &kernel,
|
||||
const std::initializer_list<ParameterType> &types)
|
||||
{
|
||||
bool needsFp64 = false;
|
||||
bool needsFp16 = false;
|
||||
|
||||
for (const auto &type : types)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case ParameterType::Double: needsFp64 = true; break;
|
||||
|
||||
case ParameterType::Half: needsFp16 = true; break;
|
||||
case ParameterType::Float:
|
||||
case ParameterType::Short:
|
||||
case ParameterType::UShort:
|
||||
case ParameterType::Int:
|
||||
case ParameterType::UInt:
|
||||
case ParameterType::Long:
|
||||
@@ -89,6 +99,7 @@ void EmitEnableExtension(std::ostringstream &kernel,
|
||||
}
|
||||
|
||||
if (needsFp64) kernel << "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n";
|
||||
if (needsFp16) kernel << "#pragma OPENCL EXTENSION cl_khr_fp16 : enable\n";
|
||||
}
|
||||
|
||||
std::string GetBuildOptions(bool relaxed_mode)
|
||||
|
||||
Reference in New Issue
Block a user