Hi,
I think that for now gather is allowed only on 1D streams.
kernel void foo(float4 before_in[][], float4 out before_out[])
The access to 2D stream must be like this.
float2 id = float2(x,y);
stream2d[id] = 0.0;
Not like c++ [][] also.
Originally posted by: ryta1203
Not sure why this is not compiling (get "expect gather...blah blah blah", any help woud be great, from anybody:
Originally posted by: eduardoschardong Originally posted by: ryta1203
Not sure why this is not compiling (get "expect gather...blah blah blah", any help woud be great, from anybody:
The problem is the scatter, wich seens to not be supported yet, if you chnage the out from [][] to <> you won't get this error (but need to check other parts of the code for other errors).
kernel void foo(float4 before_in[][], float4 out before_out<>)
It looks like the problem is you temporal array, Brook+ probably just do not support such thinks until now.
float4 temp[100];
Originally posted by: Remotion
It looks like the problem is you temporal array, Brook+ probably just do not support such thinks until now.
float4 temp[100];
By the way where I can find AMDHLSL documentation and how to use it with CAL?
Remotion
I tried something as simple as:
kernel void foo( float4 out b4_in[][], float4 out b4_out[][] )
{
float2 pos = float2( 1.0f, 1.0f );
float4 tmp;
tmp = b4_in[pos];
b4_out[pos] = tmp;
}
This resulted in a compilation error because of the indexed assignment to b4_out: b4_out[pos] = tmp.
Are assignments to scatter streams allowed in this fashion? I.e., indexed assignments?
---jski
That's what happens in the wee hours of the night when you're experimenting but in didn't clear up the compilation bug! I still get the same compile-time error. And if I comment out the assignment: b4_out[pos] = tmp, it compiles just fine
---jski
Micah,
I added your code (listed below) to an existing project, simple_matmult, just to see if it compiled.
kernel void scatter(float4 a[][], float4 b<>, float width, out float4 c[])
{
// Get the position in the stream of the current thread
float idx = (indexof(c)).x;
float2 apos = {idx % width, floor(idx / width) };
// Write out to the scatter buffer
c[idx] = a[apos] + b;
}
And got:
WARNING: ASSERT(GetResultSymbol().IsValid() + mDataTypeValue.IsValid() >= 1) failed
While processing <buffer>:66
In compiler at ResolveSymbols()[astdelayedlookup.cpp:139]
*mName = c
Message: unknown symbol
ERROR: ASSERT(errorCount==0) failed
While processing <buffer>:115
In compiler at CompileShaderToStream()[astroot.cpp:157]
errorCount = 1
Message: Unknown Symbols exist
Aborting...
Problem with compiling built_d/simple_matmult_simple_matmult.hlslmkdir -p built_d...
---jski
Originally posted by: eduardoschardong
And I can't compile any scatter, even the scatter.br sample fails
The error:
Argument to indexof not a stream
And when commenting all indexof:
Output is not a stream: out float4 c[].
Originally posted by: ryta1203 Originally posted by: eduardoschardong
Can you post your code? That seems odd, I don't really have a problem running their scatter sample. What hardware are you using? R600 does not support scatter as far as I am aware, you must have HD38xx+ (or of course 9170, 9250).
The code is just the scatter.br...
I know I can't run it on the older GPU, but was expect to compile and run on CPU mode right?
Originally posted by: ryta1203
I would think it should run either way (CPU or GPU), can you post the code just in case? Is it the scatter sample unmodified? Maybe your environment is not setup proplery, are you having problems running any other samples?