diff options
author | fireice-uk <fireice-uk@users.noreply.github.com> | 2017-10-27 20:37:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-27 20:37:12 +0100 |
commit | c192b97b67bf648540bf058f21b7873bfe886a82 (patch) | |
tree | fe71edd305f523021c9038dab5595551c7e4c7e2 /xmrstak/backend/amd/amd_gpu/gpu.cpp | |
parent | 91b307859ea97cc1abdb17da01b94919d3521803 (diff) | |
parent | 0117ed609e69af977fabaf9c28bbf8cf1300ee89 (diff) | |
download | xmr-stak-c192b97b67bf648540bf058f21b7873bfe886a82.zip xmr-stak-c192b97b67bf648540bf058f21b7873bfe886a82.tar.gz |
Merge pull request #67 from psychocrypt/topic-aeon2
add Aeon support
Diffstat (limited to 'xmrstak/backend/amd/amd_gpu/gpu.cpp')
-rw-r--r-- | xmrstak/backend/amd/amd_gpu/gpu.cpp | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/xmrstak/backend/amd/amd_gpu/gpu.cpp b/xmrstak/backend/amd/amd_gpu/gpu.cpp index 3575854..22ce5d0 100644 --- a/xmrstak/backend/amd/amd_gpu/gpu.cpp +++ b/xmrstak/backend/amd/amd_gpu/gpu.cpp @@ -13,6 +13,9 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "xmrstak/backend/cryptonight.hpp" +#include "xmrstak/jconf.hpp" + #include <stdio.h> #include <string.h> #include <math.h> @@ -245,8 +248,24 @@ size_t InitOpenCLGpu(cl_context opencl_ctx, GpuContext* ctx, const char* source_ return ERR_OCL_API; } + size_t hashMemSize; + int threadMemMask; + int hasIterations; + if(::jconf::inst()->IsCurrencyMonero()) + { + hashMemSize = MONERO_MEMORY; + threadMemMask = MONERO_MASK; + hasIterations = MONERO_ITER; + } + else + { + hashMemSize = AEON_MEMORY; + threadMemMask = AEON_MASK; + hasIterations = AEON_ITER; + } + size_t g_thd = ctx->rawIntensity; - ctx->ExtraBuffers[0] = clCreateBuffer(opencl_ctx, CL_MEM_READ_WRITE, (1 << 21) * g_thd, NULL, &ret); + ctx->ExtraBuffers[0] = clCreateBuffer(opencl_ctx, CL_MEM_READ_WRITE, hashMemSize * g_thd, NULL, &ret); if(ret != CL_SUCCESS) { printer::inst()->print_msg(L1,"Error %s when calling clCreateBuffer to create hash scratchpads buffer.", err_to_str(ret)); @@ -307,8 +326,9 @@ size_t InitOpenCLGpu(cl_context opencl_ctx, GpuContext* ctx, const char* source_ return ERR_OCL_API; } - char options[32]; - snprintf(options, sizeof(options), "-I. -DWORKSIZE=%llu", int_port(ctx->workSize)); + char options[256]; + snprintf(options, sizeof(options), + "-DITERATIONS=%d -DMASK=%d -DWORKSIZE=%llu", hasIterations, threadMemMask, int_port(ctx->workSize)); ret = clBuildProgram(ctx->Program, 1, &ctx->DeviceID, options, NULL, NULL); if(ret != CL_SUCCESS) { |