/
redgpu
/
clspv
Обзор
Документация
Войти
/
redgpu
/
clspv
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
test/LongVectorLowering/builtinfunctions.cl
56 строк
2 KB
Marco Antognini
Lower additional OpenCL builtin functions (#690)
04 янв 2021, 17:42
Не верифицирован
04 янв 2021, 17:42
c981816
Код
Авторство
О чём код?
// RUN: clspv %s --long-vector -verify // RUN: clspv %s --long-vector -o %t.spv // RUN: spirv-dis %t.spv -o - | FileCheck %s // RUN: spirv-val --target-env vulkan1.0 %t.spv // Ensure all builtins are declared (i.e. there are no warnings about implicit // declaration). // // expected-no-diagnostics // Check that calling multiple overloads of a BIF is supported. // CHECK: [[EXT:%[0-9]+]] = OpExtInstImport "GLSL.std.450" // // CHECK-DAG: [[UINT:%[a-zA-Z0-9_]+]] = OpTypeInt 32 0 // CHECK-DAG: [[UINT4:%[a-zA-Z0-9_]+]] = OpTypeVector [[UINT]] 4 kernel void test(global int *in, global int *out) { { int8 a = vload8(0, in); int8 b = vload8(1, in); // CHECK: OpExtInst [[UINT]] [[EXT]] SMax {{%[0-9]+}} {{%[0-9]+}} // CHECK: OpExtInst [[UINT]] [[EXT]] SMax {{%[0-9]+}} {{%[0-9]+}} // CHECK: OpExtInst [[UINT]] [[EXT]] SMax {{%[0-9]+}} {{%[0-9]+}} // CHECK: OpExtInst [[UINT]] [[EXT]] SMax {{%[0-9]+}} {{%[0-9]+}} // CHECK: OpExtInst [[UINT]] [[EXT]] SMax {{%[0-9]+}} {{%[0-9]+}} // CHECK: OpExtInst [[UINT]] [[EXT]] SMax {{%[0-9]+}} {{%[0-9]+}} // CHECK: OpExtInst [[UINT]] [[EXT]] SMax {{%[0-9]+}} {{%[0-9]+}} // CHECK: OpExtInst [[UINT]] [[EXT]] SMax {{%[0-9]+}} {{%[0-9]+}} int8 c = max(a, b); vstore8(c, 0, out); } { int8 a = vload8(0, in); int8 b = vload8(1, in); // CHECK: OpExtInst [[UINT]] [[EXT]] SMax {{%[0-9]+}} [[B:%[^ ]+]] // CHECK: OpExtInst [[UINT]] [[EXT]] SMax {{%[0-9]+}} [[B]] // CHECK: OpExtInst [[UINT]] [[EXT]] SMax {{%[0-9]+}} [[B]] // CHECK: OpExtInst [[UINT]] [[EXT]] SMax {{%[0-9]+}} [[B]] // CHECK: OpExtInst [[UINT]] [[EXT]] SMax {{%[0-9]+}} [[B]] // CHECK: OpExtInst [[UINT]] [[EXT]] SMax {{%[0-9]+}} [[B]] // CHECK: OpExtInst [[UINT]] [[EXT]] SMax {{%[0-9]+}} [[B]] // CHECK: OpExtInst [[UINT]] [[EXT]] SMax {{%[0-9]+}} [[B]] int8 c = max(a, b.s0); vstore8(c, 0, out); } { int4 a = vload4(0, in); int4 b = vload4(1, in); // CHECK: OpExtInst [[UINT4]] [[EXT]] SMax {{%[0-9]+}} {{%[0-9]+}} int4 c = max(a, b); vstore4(c, 2, out); } }