This repository was archived by the owner on Mar 28, 2023. It is now read-only.
forked from llvm/llvm-test-suite
-
Notifications
You must be signed in to change notification settings - Fork 130
[SYCL][libdevice] Tests for half value type cast utils. #1301
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
8d80f64
[SYCL][libdevice] Tests for half value type cast utils.
jinge90 d8fb267
Add tests for short2half
jinge90 e17ff27
fix clang format
jinge90 a1f6f83
add tests for ushort2half
jinge90 ec82f1a
add tests for int2half conversion
jinge90 a470c3b
Finish int2half tests
jinge90 6c772e3
add tests for uint2half
jinge90 4ec37ce
add tests for ll2half, ull2half
jinge90 07617d7
add tests for float2half
jinge90 6677ee3
Add test for double2half
jinge90 ce4c08e
add -0 half input
jinge90 26c5daf
add -0 input for float2half
jinge90 d03108c
cover +/-max/min subnormal input
jinge90 816506c
Merge remote-tracking branch 'upstream/intel' into type-cast-for-half
jinge90 7d23d6e
disable test on CPU device temporarily, fp16 has not been fully suppo…
jinge90 99d9b26
add check for platform without fp16 support
jinge90 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// RUN: %clangxx -fsycl %s -o %t.out | ||
// RUN: %GPU_RUN_PLACEHOLDER %t.out | ||
|
||
// RUN: %clangxx -fsycl -fno-builtin -fsycl-device-lib-jit-link %s -o %t.out | ||
// RUN: %GPU_RUN_PLACEHOLDER %t.out | ||
// | ||
// UNSUPPORTED: cuda || hip | ||
|
||
#include "imf_utils.hpp" | ||
|
||
extern "C" { | ||
_iml_half_internal __imf_double2half(double); | ||
} | ||
|
||
int main() { | ||
|
||
sycl::queue device_queue(sycl::default_selector_v); | ||
std::cout << "Running on " | ||
<< device_queue.get_device().get_info<sycl::info::device::name>() | ||
<< "\n"; | ||
|
||
if (!device_queue.get_device().has(sycl::aspect::fp64)) { | ||
std::cout << "Test skipped on platform without fp64 support." << std::endl; | ||
return 0; | ||
} | ||
|
||
if (!device_queue.get_device().has(sycl::aspect::fp16)) { | ||
std::cout << "Test skipped on platform without fp16 support." << std::endl; | ||
return 0; | ||
} | ||
|
||
{ | ||
std::initializer_list<uint64_t> input_vals = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this just a sanity check or detailed test?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi, @akolesov-intel |
||
0, // 0 | ||
0x7FF0000000000000, // +infinity | ||
0xFFF0000000000000, // -infinity | ||
0x4026800000000000, // 11.25 | ||
0x409025643C8E4F03, // 1033.3478872524 | ||
0x40EFFC0000000000, // 65504 | ||
0xC0EFFC0000000000, // -65504 | ||
0xC0D38814311F5D54, // -20000.31549820055245 | ||
0x409F9B8D12ACEFA7, // 2022.887766554 | ||
0x40ee120000000000, // 61584 | ||
0xC0EE160000000000, // -61616 | ||
0x40FAA93000000000, // 109203 | ||
0xC1A7D8B7FF20E365, // -200039423.56423487283 | ||
0x3C370EF54646D497, // 1.25e-18 | ||
0xBCB1B3CFC61ACF52, // -2.4567e-16 | ||
0x39F036448D68D482, // 1.2789e-29 | ||
0xB99C100A89BE0A2D, // -3.45899e-31 | ||
}; | ||
std::initializer_list<uint16_t> ref_vals = { | ||
0, 0x7C00, 0xFC00, 0x49A0, 0x6409, 0x7BFF, 0xFBFF, 0xF4E2, 0x67E7, | ||
0x7B84, 0xFB86, 0x7C00, 0xFC00, 0, 0x8000, 0, 0x8000}; | ||
|
||
test_host(input_vals, ref_vals, F_Half4(__imf_double2half)); | ||
test(device_queue, input_vals, ref_vals, F_Half4(__imf_double2half)); | ||
} | ||
|
||
return 0; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.