Added functionality with atomicadd
This commit is contained in:
parent
9a40465d69
commit
71129392c2
4 changed files with 57 additions and 23 deletions
|
|
@ -16,6 +16,8 @@ TEST(TestMultipleAlgoExecutions, TestEndToEndFunctionality)
|
|||
std::string shader = (R"(
|
||||
#version 450
|
||||
|
||||
#extension GL_EXT_shader_atomic_float: enable
|
||||
|
||||
layout (local_size_x = 1) in;
|
||||
|
||||
// The input tensors bind index is relative to index in parameter passed
|
||||
|
|
@ -34,8 +36,8 @@ TEST(TestMultipleAlgoExecutions, TestEndToEndFunctionality)
|
|||
|
||||
void main() {
|
||||
uint index = gl_GlobalInvocationID.x;
|
||||
out_a[index] += in_a[index] * in_b[index];
|
||||
out_b[index] += const_one * push_const.val;
|
||||
atomicAdd(out_a[index], in_a[index] * in_b[index]);
|
||||
atomicAdd(out_b[index], const_one * push_const.val);
|
||||
}
|
||||
)");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue