Skip to content

Commit

Permalink
Fix two new warnings within new code
Browse files Browse the repository at this point in the history
  • Loading branch information
Spudz76 committed Oct 6, 2018
1 parent b0ccccf commit 2370aee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion xmrstak/backend/amd/amd_gpu/gpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ size_t InitOpenCLGpu(cl_context opencl_ctx, GpuContext* ctx, const char* source_
}

std::vector<char> openCLDriverVer(1024);
if(ret = clGetDeviceInfo(ctx->DeviceID, CL_DRIVER_VERSION, openCLDriverVer.size(), openCLDriverVer.data(), NULL) != CL_SUCCESS)
if((ret = clGetDeviceInfo(ctx->DeviceID, CL_DRIVER_VERSION, openCLDriverVer.size(), openCLDriverVer.data(), NULL)) != CL_SUCCESS)
{
printer::inst()->print_msg(L1,"WARNING: %s when calling clGetDeviceInfo to get CL_DRIVER_VERSION for device %u.", err_to_str(ret),ctx->deviceIdx );
return ERR_OCL_API;
Expand Down
21 changes: 11 additions & 10 deletions xmrstak/backend/cpu/minethd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,18 +458,19 @@ std::vector<iBackend*> minethd::thread_starter(uint32_t threadOffset, miner_work
static std::string getAsmName(const uint32_t num_hashes)
{
std::string asm_type = "off";
if(num_hashes == 0)
return asm_type;

auto cpu_model = getModel();

if(cpu_model.avx && cpu_model.aes)
if(num_hashes != 0)
{
if(cpu_model.type_name.find("Intel") != std::string::npos)
asm_type = "intel_avx";
else if(cpu_model.type_name.find("AMD") != std::string::npos && num_hashes == 1)
asm_type = "amd_avx";
auto cpu_model = getModel();

if(cpu_model.avx && cpu_model.aes)
{
if(cpu_model.type_name.find("Intel") != std::string::npos)
asm_type = "intel_avx";
else if(cpu_model.type_name.find("AMD") != std::string::npos && num_hashes == 1)
asm_type = "amd_avx";
}
}
return asm_type;
}

template<size_t N>
Expand Down

0 comments on commit 2370aee

Please sign in to comment.