-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change stride to 4 instead of 1 if int8 is not supported (#1397)
* change stride to 2 instead of 1 if int8 is not supported * add unit test * add EOF line * add second unit test from the issue * use func * fix comment
- Loading branch information
Showing
3 changed files
with
55 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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,17 @@ | ||
// RUN: clspv -int8=0 %target %s -o %t.spv | ||
// RUN: spirv-dis -o %t2.spvasm %t.spv | ||
// RUN: FileCheck %s < %t2.spvasm | ||
// RUN: spirv-val --target-env vulkan1.0 %t.spv | ||
|
||
constant uchar b[4] = {[0]=42, [1]=13, [2]=0, [3]=5}; | ||
|
||
void kernel __attribute__((reqd_work_group_size(4, 1, 1))) foo(global uchar* a) | ||
{ | ||
*a = b[get_local_id(0)]; | ||
} | ||
|
||
// CHECK-DAG: [[uint:%[^ ]+]] = OpTypeInt 32 0 | ||
// CHECK-DAG: OpTypePointer StorageBuffer [[struct:%[^ ]+]] | ||
// CHECK-DAG: [[struct]] = OpTypeStruct [[runtimearr:%[^ ]+]] | ||
// CHECK-DAG: OpDecorate [[runtimearr]] ArrayStride 4 | ||
|
This file contains 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,26 @@ | ||
// RUN: clspv -int8=0 %target %s -o %t.spv | ||
// RUN: spirv-dis -o %t2.spvasm %t.spv | ||
// RUN: FileCheck %s < %t2.spvasm | ||
// RUN: spirv-val --target-env vulkan1.0 %t.spv | ||
|
||
__kernel void helloWorld(__global char* data){ | ||
data[0] = 'H'; | ||
data[1] = 'e'; | ||
data[2] = 'l'; | ||
data[3] = 'l'; | ||
data[4] = 'o'; | ||
data[5] = ' '; | ||
data[6] = 'W'; | ||
data[7] = 'o'; | ||
data[8] = 'r'; | ||
data[9] = 'l'; | ||
data[10] = 'd'; | ||
data[11] = '!'; | ||
data[12] = '\n'; | ||
data[13] = 0; | ||
} | ||
|
||
// CHECK-DAG: [[uint:%[^ ]+]] = OpTypeInt 32 0 | ||
// CHECK-DAG: OpTypePointer StorageBuffer [[struct:%[^ ]+]] | ||
// CHECK-DAG: [[struct]] = OpTypeStruct [[runtimearr:%[^ ]+]] | ||
// CHECK-DAG: OpDecorate [[runtimearr]] ArrayStride 4 |