Skip to content
Permalink
Browse files
Don't define AMDGPU when would be ==0
  • Loading branch information
preda committed Dec 9, 2019
1 parent 14c60f9 commit 1af537800bedfee6eb3ed9fd4f93efdfe99a9ad1
Showing with 6 additions and 8 deletions.
  1. +5 −4 Gpu.cpp
  2. +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;

0 comments on commit 1af5378

Please sign in to comment.