/
redgpu
/
ispc
Обзор
Документация
Войти
/
redgpu
/
ispc
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tests/lit-tests/func_template_array_7.ispc
15 строк
497 B
Arina Neshlyaeva
Lit tests for templated arrays
27 сен 2024, 01:27
27 сен 2024, 01:27
ac9b94a
Код
Авторство
О чём код?
// Check out of bounds warning for arrays inside templates. // RUN: %{ispc} --target=host --nowrap --nostdlib %s 2>&1 | FileCheck %s // CHECK-COUNT-1: Warning: Array index "8" may be out of bounds for 8 element array. template <int C> void testArrayAccess(uniform int ret[], uniform int arr[]) { uniform int O[C] = {0}; ret[0] = O[arr[0] % C]; // Valid access ret[1] = O[C]; // Non-Valid access } void test(uniform int ret[], uniform int arr[]) { testArrayAccess<8>(ret, arr); }