/
redgpu
/
ispc
Обзор
Документация
Войти
/
redgpu
/
ispc
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
test
tests/operators1.ispc
62 строки
1 KB
Arina Neshlyaeva
Adapt test system to redefined meaning of "task" functions on GPU.
13 авг 2021, 08:32
13 авг 2021, 08:32
2aa444f
Код
Авторство
О чём код?
#include "../test_static.isph" struct S { float a; }; // References "struct&" were put in random order to test them. struct S operator*(struct S& rr, struct S rv) { struct S c; c.a = rr.a + rv.a + 2; return c; } struct S operator/(struct S& rr, struct S& rv) { struct S c; c.a = rr.a - rr.a + 2; return c; } struct S operator%(struct S rr, struct S& rv) { struct S c; c.a = rr.a + rv.a + 2; return c; } struct S operator+(struct S rr, struct S rv) { struct S c; c.a = rr.a / rv.a + 3; return c; } struct S operator-(struct S rr, struct S& rv) { struct S c; c.a = rr.a + rv.a + 2; return c; } struct S operator>>(struct S& rr, struct S rv) { struct S c; c.a = rr.a / rv.a + 3; return c; } struct S operator<<(struct S& rr, struct S& rv) { struct S c; c.a = rr.a + rv.a + 2; return c; } struct S a; struct S b; struct S d; task void f_f(uniform float RET[], uniform float aFOO[]) { a.a = 5; b.a = -5; d = a * b + b / a - a << (b - b) - a; RET[programIndex] = d.a; } task void result(uniform float RET[4]) { RET[programIndex] = 12; }