Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Don't define AMDGPU when would be ==0
- Loading branch information
Showing
with
6 additions
and
8 deletions.
-
+5
−4
Gpu.cpp
-
+1
−4
gpuowl.cl
|
|
@@ -146,11 +146,9 @@ extern const char *CL_SOURCE; |
|
|
|
|
|
static cl_program compile(const Args& args, cl_context context, u32 N, u32 E, u32 WIDTH, u32 SMALL_HEIGHT, u32 MIDDLE, u32 nW) { |
|
|
string clArgs = args.dump.empty() ? ""s : (" -save-temps="s + args.dump + "/" + numberK(N)); |
|
|
cl_device_id id = getDevice(args.device); |
|
|
|
|
|
|
|
|
vector<pair<string, std::any>> defines = |
|
|
{{"AMDGPU", int(isAmdGpu(id))}, |
|
|
{"EXP", E}, |
|
|
{{"EXP", E}, |
|
|
{"WIDTH", WIDTH}, |
|
|
{"SMALL_HEIGHT", SMALL_HEIGHT}, |
|
|
{"MIDDLE", MIDDLE}, |
|
|
@@ -159,6 +157,9 @@ static cl_program compile(const Args& args, cl_context context, u32 N, u32 E, u3 |
|
|
{"WEIGHT_BIGSTEP", double(weight(N, E, SMALL_HEIGHT * MIDDLE, 0, WIDTH / nW, 0))}, |
|
|
{"IWEIGHT_BIGSTEP", double(invWeight(N, E, SMALL_HEIGHT * MIDDLE, 0, WIDTH / nW, 0))}, |
|
|
}; |
|
|
|
|
|
cl_device_id id = getDevice(args.device); |
|
|
if (isAmdGpu(id)) { defines.push_back({"AMDGPU", 1}); } |
|
|
|
|
|
for (const string& flag : args.flags) { defines.push_back(pair{flag, 1}); } |
|
|
|
|
|
|
|
|
@@ -21,14 +21,11 @@ |
|
|
// On AMDGPU the default is HAS_ASM |
|
|
#if !NO_ASM |
|
|
#define HAS_ASM 1 |
|
|
// #warning ASM is enabled (pass '-use NO_ASM' to disable it) |
|
|
#endif |
|
|
|
|
|
#endif |
|
|
|
|
|
#if HAS_ASM |
|
|
// #warning ASM is enabled (pass '-use NO_ASM' to disable it) |
|
|
#endif |
|
|
|
|
|
typedef int i32; |
|
|
typedef uint u32; |
|
|
typedef long i64; |
|
|
|