[Piglit] [PATCH 3/4] cl: Add vstore_half float test

Jan Vesely jan.vesely at rutgers.edu
Sat Jul 30 17:56:05 UTC 2016


Passed on intel(CPU), clover(AMD Kaveri), beignet, CUDA

Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
---
 tests/cl/program/execute/vstore_half-float.cl | 137 ++++++++++++++++++++++++++
 1 file changed, 137 insertions(+)
 create mode 100644 tests/cl/program/execute/vstore_half-float.cl

diff --git a/tests/cl/program/execute/vstore_half-float.cl b/tests/cl/program/execute/vstore_half-float.cl
new file mode 100644
index 0000000..f05d4ec
--- /dev/null
+++ b/tests/cl/program/execute/vstore_half-float.cl
@@ -0,0 +1,137 @@
+/*!
+[config]
+name: Vector store_half float2,3,4,8,16
+clc_version_min: 10
+
+dimensions: 1
+global_size: 1 0 0
+
+[test]
+name: scalar store_half float
+kernel_name: vstore_half_test
+arg_out: 0 buffer half[1] 34.0
+arg_in: 1 buffer float[1] 34.0
+
+[test]
+name: vector store_half float2
+kernel_name: vstore_half2_test
+arg_out: 0 buffer half[2] 56.0 65.0
+arg_in: 1 buffer float[2] 56.0 65.0
+
+[test]
+name: vector store_half float2 with offset
+kernel_name: vstore_half2_offset
+arg_out: 0 buffer half[4] 0 0 56.0 65.0
+arg_in: 1 buffer float[2] 56.0 65.0
+
+[test]
+name: vector store_half float3
+kernel_name: vstore_half3_test
+arg_out: 0 buffer half[3] 56.0 65.0 12.0
+arg_in: 1 buffer float[3] 56.0 65.0 12.0
+
+[test]
+name: vector store_half float3 with offset
+kernel_name: vstore_half3_offset
+arg_out: 0 buffer half[6] 0 0 0 56.0 65.0 12.0
+arg_in: 1 buffer float[3] 56.0 65.0 12.0
+
+[test]
+name: vector store_half float4
+kernel_name: vstore_half4_test
+arg_out: 0 buffer half[4] 56.0 65.0 18.0 81.0
+arg_in: 1 buffer float[4] 56.0 65.0 18.0 81.0
+
+[test]
+name: vector store_half float4 with offset
+kernel_name: vstore_half4_offset
+arg_out: 0 buffer half[8] 0 0 0 0 56.0 65.0 18.0 81.0
+arg_in: 1 buffer float[4] 56.0 65.0 18.0 81.0
+
+[test]
+name: vector store_half float8
+kernel_name: vstore_half8_test
+arg_out: 0 buffer half[8] 56.0 65.0 18.0 81.0 12.0 21.0 34.0 43.0
+arg_in: 1 buffer float[8] 56.0 65.0 18.0 81.0 12.0 21.0 34.0 43.0
+
+[test]
+name: vector store_half float8 with offset
+kernel_name: vstore_half8_offset
+arg_out: 0 buffer half[16] 0 0 0 0 0 0 0 0 56.0 65.0 18.0 81.0 12.0 21.0 34.0 43.0
+arg_in: 1 buffer float[8] 56.0 65.0 18.0 81.0 12.0 21.0 34.0 43.0
+
+[test]
+name: vector store_half float16
+kernel_name: vstore_half16_test
+arg_out: 0 buffer half[16] 56.0 65.0 18.0 81.0 12.0 21.0 34.0 43.0 23.0 32.0 67.0 76.0 78.0 87.0 89.0 98.0
+arg_in: 1 buffer float[16] 56.0 65.0 18.0 81.0 12.0 21.0 34.0 43.0 23.0 32.0 67.0 76.0 78.0 87.0 89.0 98.0
+
+[test]
+name: vector store_half float16 with offset
+kernel_name: vstore_half16_offset
+arg_out: 0 buffer half[32] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \
+                         56.0 65.0 18.0 81.0 12.0 21.0 34.0 43.0 23.0 32.0 67.0 76.0 78.0 87.0 89.0 98.0
+arg_in: 1 buffer float[16] 56.0 65.0 18.0 81.0 12.0 21.0 34.0 43.0 23.0 32.0 67.0 76.0 78.0 87.0 89.0 98.0
+!*/
+
+kernel void vstore_half_test(global half* out, global float* in) {
+  float val = in[0];
+  vstore_half(val, 0, out);
+}
+
+kernel void vstore_half2_test(global half* out, global float* in) {
+  float2 val = {in[0], in[1]};
+  vstore_half2(val, 0, out);
+}
+
+kernel void vstore_half2_offset(global half* out, global float* in) {
+  float2 val = {in[0], in[1]};
+  vstore_half2((float2)0, 0, out);
+  vstore_half2(val, 1, out);
+}
+
+kernel void vstore_half3_test(global half* out, global float* in) {
+  float3 val = {in[0], in[1], in[2]};
+  vstore_half3(val, 0, out);
+}
+
+kernel void vstore_half3_offset(global half* out, global float* in) {
+  float3 val = {in[0], in[1], in[2]};
+  vstore_half3((float3)0, 0, out);
+  vstore_half3(val, 1, out);
+}
+
+kernel void vstore_half4_test(global half* out, global float* in) {
+  float4 val = {in[0], in[1], in[2], in[3]};
+  vstore_half4(val, 0, out);
+}
+
+kernel void vstore_half4_offset(global half* out, global float* in) {
+  float4 val = {in[0], in[1], in[2], in[3]};
+  vstore_half4((float4)0, 0, out);
+  vstore_half4(val, 1, out);
+}
+
+kernel void vstore_half8_test(global half* out, global float* in) {
+  float8 val = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]};
+  vstore_half8(val, 0, out);
+}
+
+kernel void vstore_half8_offset(global half* out, global float* in) {
+  float8 val = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]};
+  vstore_half8((float8)0, 0, out);
+  vstore_half8(val, 1, out);
+}
+
+kernel void vstore_half16_test(global half* out, global float* in) {
+  float16 val = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7],
+               in[8], in[9], in[10], in[11], in[12], in[13], in[14], in[15]};
+  vstore_half16(val, 0, out);
+}
+
+kernel void vstore_half16_offset(global half* out, global float* in) {
+  float16 val = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7],
+               in[8], in[9], in[10], in[11], in[12], in[13], in[14], in[15]};
+  vstore_half16((float16)0, 0, out);
+  vstore_half16(val, 1, out);
+}
-- 
2.7.4



More information about the Piglit mailing list