diff options
author | psychocrypt <psychocrypt@users.noreply.github.com> | 2017-10-24 21:24:37 +0200 |
---|---|---|
committer | psychocrypt <psychocrypt@users.noreply.github.com> | 2017-10-27 20:12:01 +0200 |
commit | 2346c8be20939fe9c34cee441ac11644ec43cc58 (patch) | |
tree | 5c8c23365a3f1417854f4c5b92ef07e55c077a20 /xmrstak/backend/amd/amd_gpu/gpu.cpp | |
parent | e0f0ad4d03af36d302485e46e22f47edba96b40d (diff) | |
download | xmr-stak-2346c8be20939fe9c34cee441ac11644ec43cc58.zip xmr-stak-2346c8be20939fe9c34cee441ac11644ec43cc58.tar.gz |
add eon support to amd backend
- add compile parameter to support aeon and xmr
- update auto suggestion to handle aeon
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..845d32c 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 "../../cryptonight.hpp" +#include "../../../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()->IsCurrencyXMR()) + { + hashMemSize = XMR_MEMORY; + threadMemMask = XMR_MASK; + hasIterations = XMR_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) { |