Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
xmrig committed Mar 6, 2019
2 parents 0d1a86d + 6dbec6d commit de56393
Show file tree
Hide file tree
Showing 51 changed files with 4,163 additions and 3,955 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# v2.14.0
- **[#227](https://github.com/xmrig/xmrig-amd/pull/227) Added new algorithm `cryptonight/rwz`, short alias `cn/rwz` (also known as CryptoNight ReverseWaltz), for upcoming [Graft](https://www.graft.network/) fork.**
- **[#931](https://github.com/xmrig/xmrig/issues/931) Added new algorithm `cryptonight/zls`, short alias `cn/zls` for [Zelerius Network](https://zelerius.org) fork.**
- **[#940](https://github.com/xmrig/xmrig/issues/940) Added new algorithm `cryptonight/double`, short alias `cn/double` (also known as CryptoNight HeavyX), for [X-CASH](https://x-cash.org/).**
- [#951](https://github.com/xmrig/xmrig/issues/951#issuecomment-469581529) Fixed crash if AVX was disabled on OS level.
- [#952](https://github.com/xmrig/xmrig/issues/952) Fixed compile error on some Linux.
- [#957](https://github.com/xmrig/xmrig/issues/957#issuecomment-468890667) Added support for embedded config.

# v2.13.0
- **[#938](https://github.com/xmrig/xmrig/issues/938) Added support for new algorithm `cryptonight/r`, short alias `cn/r` (also known as CryptoNightR or CryptoNight variant 4), for upcoming [Monero](https://www.getmonero.org/) fork on March 9, thanks [@SChernykh](https://github.com/SChernykh).**
- [#939](https://github.com/xmrig/xmrig/issues/939) Added support for dynamic (runtime) pools reload.
Expand Down
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ option(ARM_TARGET "Force use specific ARM target 8 or 7" 0)

option(WITH_DEBUG_LOG "Enable debug log output, network, etc" OFF)
option(WITH_INTERLEAVE_DEBUG_LOG "Enable debug log for threads interleave" OFF)
option(WITH_EMBEDDED_CONFIG "Enable internal embedded JSON config" OFF)

include (CheckIncludeFile)
include (cmake/cpu.cmake)
Expand Down Expand Up @@ -76,6 +77,7 @@ set(HEADERS
src/common/utils/mm_malloc.h
src/common/utils/timestamp.h
src/common/xmrig.h
src/core/ConfigLoader_default.h
src/core/ConfigLoader_platform.h
src/core/Controller.h
src/core/usage.h
Expand Down Expand Up @@ -265,6 +267,10 @@ if (NOT WITH_CN_PICO)
add_definitions(/DXMRIG_NO_CN_PICO)
endif()

if (WITH_EMBEDDED_CONFIG)
add_definitions(/DXMRIG_FEATURE_EMBEDDED_CONFIG)
endif()

if (WITH_HTTPD)
find_package(MHD)

Expand Down
4 changes: 2 additions & 2 deletions cmake/asm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if (WITH_ASM AND NOT XMRIG_ARM AND CMAKE_SIZEOF_VOID_P EQUAL 8)
if (WIN32 AND CMAKE_C_COMPILER_ID MATCHES GNU)
set(XMRIG_ASM_FILES
"src/crypto/asm/win64/cn_main_loop.S"
"src/crypto/asm/win64/CryptonightR_template.S"
"src/crypto/asm/CryptonightR_template.S"
)
else()
set(XMRIG_ASM_FILES
Expand All @@ -36,7 +36,7 @@ if (WITH_ASM AND NOT XMRIG_ARM AND CMAKE_SIZEOF_VOID_P EQUAL 8)
endif()

add_library(${XMRIG_ASM_LIBRARY} STATIC ${XMRIG_ASM_FILES})
set(XMRIG_ASM_SOURCES "")
set(XMRIG_ASM_SOURCES src/crypto/CryptonightR_gen.cpp)
set_property(TARGET ${XMRIG_ASM_LIBRARY} PROPERTY LINKER_LANGUAGE C)
else()
set(XMRIG_ASM_SOURCES "")
Expand Down
6 changes: 3 additions & 3 deletions cmake/cn-gpu.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ if (WITH_CN_GPU AND CMAKE_SIZEOF_VOID_P EQUAL 8)
set(CN_GPU_SOURCES src/crypto/cn_gpu_arm.cpp)

if (CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
set_source_files_properties(src/crypto/cn_gpu_arm.cpp PROPERTIES COMPILE_FLAGS "-O3")
set_source_files_properties(src/crypto/cn_gpu_arm.cpp PROPERTIES COMPILE_FLAGS "-O2")
endif()
else()
set(CN_GPU_SOURCES src/crypto/cn_gpu_avx.cpp src/crypto/cn_gpu_ssse3.cpp)

if (CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
set_source_files_properties(src/crypto/cn_gpu_avx.cpp PROPERTIES COMPILE_FLAGS "-O3 -mavx2")
set_source_files_properties(src/crypto/cn_gpu_ssse3.cpp PROPERTIES COMPILE_FLAGS "-O3")
set_source_files_properties(src/crypto/cn_gpu_avx.cpp PROPERTIES COMPILE_FLAGS "-O2 -mavx2")
set_source_files_properties(src/crypto/cn_gpu_ssse3.cpp PROPERTIES COMPILE_FLAGS "-O2")
elseif (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
set_source_files_properties(src/crypto/cn_gpu_avx.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX")
endif()
Expand Down
4 changes: 2 additions & 2 deletions src/amd/OclCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ cl_int OclCache::wait_build(cl_program program, cl_device_id device)
}


void OclCache::getOptions(xmrig::Algo algo, xmrig::Variant variant, const GpuContext* ctx, char* options, size_t options_size)
void OclCache::getOptions(xmrig::Algo algo, xmrig::Variant, const GpuContext* ctx, char* options, size_t options_size)
{
snprintf(options, options_size, "-DITERATIONS=%u -DMASK=%u -DWORKSIZE=%zu -DSTRIDED_INDEX=%d -DMEM_CHUNK_EXPONENT=%d -DCOMP_MODE=%d -DMEMORY=%zu "
"-DALGO=%d -DUNROLL_FACTOR=%d -DOPENCL_DRIVER_MAJOR=%d -DWORKSIZE_GPU=%zu -cl-fp32-correctly-rounded-divide-sqrt",
xmrig::cn_select_iter(algo, variant),
xmrig::cn_select_iter(algo, xmrig::VARIANT_AUTO),
xmrig::cn_select_mask(algo),
ctx->workSize,
ctx->stridedIndex,
Expand Down
26 changes: 25 additions & 1 deletion src/amd/OclGPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,27 @@ inline static int cn1KernelOffset(xmrig::Variant variant)
case xmrig::VARIANT_HALF:
return 12;

// 13, 14 reserved for cn/gpu cn0

# ifndef XMRIG_NO_CN_GPU
case xmrig::VARIANT_GPU:
return 15;
# endif

// 16 reserved for cn/gpu cn2

case xmrig::VARIANT_RWZ:
return 17;

case xmrig::VARIANT_ZLS:
return 18;

case xmrig::VARIANT_DOUBLE:
return 19;

case xmrig::VARIANT_WOW:
case xmrig::VARIANT_4:
return 17;
return 20;

default:
break;
Expand Down Expand Up @@ -249,11 +262,18 @@ size_t InitOpenCLGpu(int index, cl_context opencl_ctx, GpuContext* ctx, const ch
"cn1_monero", "cn1_msr", "cn1_xao", "cn1_tube", "cn1_v2_monero", "cn1_v2_half",
# ifndef XMRIG_NO_CN_GPU
"cn0_cn_gpu", "cn00_cn_gpu", "cn1_cn_gpu", "cn2_cn_gpu",
# else
"", "", "", "",
# endif
"cn1_v2_rwz", "cn1_v2_zls", "cn1_v2_double",

nullptr
};
for (int i = 0; KernelNames[i]; ++i) {
if (!KernelNames[i][0]) {
continue;
}

ctx->Kernels[i] = OclLib::createKernel(ctx->Program, KernelNames[i], &ret);
if (ret != CL_SUCCESS) {
return OCL_ERR_API;
Expand Down Expand Up @@ -473,6 +493,9 @@ size_t InitOpenCL(const std::vector<GpuContext *> &contexts, xmrig::Config *conf
const char *cryptonightCL =
#include "./opencl/cryptonight.cl"
;
const char *cryptonightCL2 =
#include "./opencl/cryptonight2.cl"
;
const char *blake256CL =
#include "./opencl/blake256.cl"
;
Expand All @@ -499,6 +522,7 @@ size_t InitOpenCL(const std::vector<GpuContext *> &contexts, xmrig::Config *conf
;

std::string source_code(cryptonightCL);
source_code.append(cryptonightCL2);
source_code = std::regex_replace(source_code, std::regex("XMRIG_INCLUDE_WOLF_AES"), wolfAesCL);
source_code = std::regex_replace(source_code, std::regex("XMRIG_INCLUDE_WOLF_SKEIN"), wolfSkeinCL);
source_code = std::regex_replace(source_code, std::regex("XMRIG_INCLUDE_JH"), jhCL);
Expand Down
1 change: 0 additions & 1 deletion src/amd/opencl/cryptonight.cl
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,6 @@ __kernel void cn1_v2_half(__global uint4 *Scratchpad, __global ulong *states, ui
# endif
}


)==="
R"===(

Expand Down
Loading

0 comments on commit de56393

Please sign in to comment.