This content has been marked as final. Show 2 replies
yes you can (at least if you build amdhlsl from source provided with the 1.2.1 SDK, i haven't tried the precompiled calutAMDhlslCompiler library). Here is what i have found out:
the groupID relativeThreadID and absoluteThread ID can be accessed by
int absTid : SV_AbsThreadId,
int relTid : SV_RelThreadId,
int gid : SV_ThreadGroupId
the number of threads, the LDS size and the sharing mode you can specify with
void main( ... )
for reading and writing to the LDS use:
float4 ReadLds(int his_tid, int offset, bool do_neighborExch);
void WriteLds(int offset, float4 data);
and for inserting a fence_threads_lds use:
I have to admit that i haven't done any tests with the compiler output yet other than sending it through the GPUShaderAnalyzer. I should also mention that you have to add some missing enums in inc/ILTables.h in order to compile amdhlsl. Still i hope this is of any help.
can I get the thread number in the kernel? I indeed found the csThreadInfo struct in hlsl file.