Skip to content

Commit

Permalink
Some white spaces removal
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaLanfranchi committed Mar 5, 2020
1 parent 706225b commit bee4dc1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion cmake/Hunter/config.cmake
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
hunter_config(CURL VERSION ${HUNTER_CURL_VERSION} CMAKE_ARGS HTTP_ONLY=ON CMAKE_USE_OPENSSL=OFF CMAKE_USE_LIBSSH2=OFF)
hunter_config(libjson-rpc-cpp VERSION ${HUNTER_libjson-rpc-cpp_VERSION} CMAKE_ARGS TCP_SOCKET_SERVER=ON)
hunter_config(libjson-rpc-cpp VERSION ${HUNTER_libjson-rpc-cpp_VERSION} CMAKE_ARGS TCP_SOCKET_SERVER=ON)
hunter_config(Boost VERSION 1.70.0-p0)
18 changes: 9 additions & 9 deletions libethash-cuda/CUDAMiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ bool CUDAMiner::init(int epoch)
cuda_init(getNumDevices(), light->light, lightData.data(), lightData.size(),
device, (s_dagLoadMode == DAG_LOAD_MODE_SINGLE), s_dagInHostMemory, s_dagCreateDevice);
s_dagLoadIndex++;

if (s_dagLoadMode == DAG_LOAD_MODE_SINGLE)
{
if (s_dagLoadIndex >= s_numInstances && s_dagInHostMemory)
Expand Down Expand Up @@ -369,7 +369,7 @@ bool CUDAMiner::cuda_init(
cudalog << "CUDA device " << string(device_props.name) << " has insufficient GPU memory." << device_props.totalGlobalMem << " bytes of memory found < " << dagBytes << " bytes of memory required";
return false;
}
//We need to reset the device and recreate the dag
//We need to reset the device and recreate the dag
cudalog << "Resetting device";
CUDA_SAFE_CALL(cudaDeviceReset());
CUdevice device;
Expand All @@ -379,23 +379,23 @@ bool CUDAMiner::cuda_init(
//We need to reset the light and the Dag for the following code to reallocate
//since cudaDeviceReset() frees all previous allocated memory
m_light[m_device_num] = nullptr;
m_dag = nullptr;
m_dag = nullptr;
}
// create buffer for cache
hash64_t * dag = m_dag;
hash64_t * light = m_light[m_device_num];

if(!light){
if(!light){
cudalog << "Allocating light with size: " << _lightBytes;
CUDA_SAFE_CALL(cudaMalloc(reinterpret_cast<void**>(&light), _lightBytes));
}
// copy lightData to device
CUDA_SAFE_CALL(cudaMemcpy(reinterpret_cast<void*>(light), _lightData, _lightBytes, cudaMemcpyHostToDevice));
m_light[m_device_num] = light;

if(dagElms != m_dag_elms || !dag) // create buffer for dag
CUDA_SAFE_CALL(cudaMalloc(reinterpret_cast<void**>(&dag), dagBytes));

if(dagElms != m_dag_elms || !dag)
{
// create mining buffers
Expand All @@ -405,7 +405,7 @@ bool CUDAMiner::cuda_init(
CUDA_SAFE_CALL(cudaMallocHost(&m_search_buf[i], sizeof(search_results)));
CUDA_SAFE_CALL(cudaStreamCreate(&m_streams[i]));
}

memset(&m_current_header, 0, sizeof(hash32_t));
m_current_target = 0;
m_current_nonce = 0;
Expand All @@ -429,7 +429,7 @@ bool CUDAMiner::cuda_init(
}
}else{
while(!hostDAG)
this_thread::sleep_for(chrono::milliseconds(100));
this_thread::sleep_for(chrono::milliseconds(100));
goto cpyDag;
}
}
Expand All @@ -441,7 +441,7 @@ bool CUDAMiner::cuda_init(
CUDA_SAFE_CALL(cudaMemcpy(reinterpret_cast<void*>(dag), hdag, dagBytes, cudaMemcpyHostToDevice));
}
}

m_dag = dag;
m_dag_elms = dagElms;

Expand Down
2 changes: 1 addition & 1 deletion libethash-cuda/CUDAMiner_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ __device__ __forceinline__ void fill_mix(uint64_t seed, uint32_t lane_id, uint32
mix[i] = kiss99(st);
}

__global__ void
__global__ void
progpow_search(
uint64_t start_nonce,
const hash32_t header,
Expand Down
2 changes: 1 addition & 1 deletion libprogpow/ProgPow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ std::string ProgPow::getKern(uint64_t block_number, kernel_t kern)
if (i < PROGPOW_CNT_MATH)
{
// Random Math
// Generate 2 unique sources
// Generate 2 unique sources
int src_rnd = rnd() % ((PROGPOW_REGS - 1) * PROGPOW_REGS);
int src1 = src_rnd % PROGPOW_REGS; // 0 <= src1 < PROGPOW_REGS
int src2 = src_rnd / PROGPOW_REGS; // 0 <= src2 < PROGPOW_REGS - 1
Expand Down

0 comments on commit bee4dc1

Please sign in to comment.