2016-01-22 18:18:55 -05:00
|
|
|
//
|
|
|
|
|
// Copyright (c) 2015 Advanced Micro Devices, Inc. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
namespace pal {
|
|
|
|
|
|
2019-06-12 10:00:38 -04:00
|
|
|
#define BLIT_KERNEL(...) #__VA_ARGS__
|
2016-01-22 18:18:55 -05:00
|
|
|
|
2019-06-12 10:00:38 -04:00
|
|
|
const char* SchedulerSourceCode = BLIT_KERNEL(
|
2017-04-13 17:41:32 -04:00
|
|
|
%s
|
|
|
|
|
\n
|
|
|
|
|
extern void __amd_scheduler(__global void*, __global void*, uint);
|
|
|
|
|
\n
|
|
|
|
|
__kernel void scheduler(__global void* queue, __global void* params, uint paramIdx) {
|
2017-04-13 13:56:38 -04:00
|
|
|
__amd_scheduler(queue, params, paramIdx);
|
2016-01-22 18:18:55 -05:00
|
|
|
}
|
2016-08-30 16:12:06 -05:00
|
|
|
\n);
|
2016-01-22 18:18:55 -05:00
|
|
|
|
2019-06-12 10:00:38 -04:00
|
|
|
const char* GwsInitSourceCode = BLIT_KERNEL(
|
|
|
|
|
\n
|
|
|
|
|
__kernel void gwsInit(uint value) {
|
|
|
|
|
unsigned int m0_backup, new_m0;
|
|
|
|
|
__asm__ __volatile__(
|
|
|
|
|
"s_mov_b32 %0 m0\n"
|
|
|
|
|
"v_readfirstlane_b32 %1 %2\n"
|
|
|
|
|
"s_nop 0\n"
|
|
|
|
|
"s_mov_b32 m0 %1\n"
|
|
|
|
|
"s_nop 0\n"
|
|
|
|
|
"ds_gws_init %3 offset:0 gds\n"
|
|
|
|
|
"s_waitcnt lgkmcnt(0) expcnt(0)\n"
|
|
|
|
|
"s_mov_b32 m0 %0\n"
|
|
|
|
|
"s_nop 0"
|
|
|
|
|
: "=s"(m0_backup), "=s"(new_m0)
|
|
|
|
|
: "v"(0 << 0x10), "{v0}"(value - 1)
|
|
|
|
|
: "memory");
|
|
|
|
|
}
|
|
|
|
|
\n);
|
|
|
|
|
|
2017-04-13 13:56:38 -04:00
|
|
|
} // namespace pal
|