Browse Source

Avoid boost dependency for libethash-cl.

cl-refactor
Gav Wood 10 years ago
parent
commit
a0b7159ce6
  1. 2
      libethash-cl/CMakeLists.txt
  2. 7
      libethash-cl/ethash_cl_miner.cpp

2
libethash-cl/CMakeLists.txt

@ -24,7 +24,7 @@ include_directories(${Boost_INCLUDE_DIRS})
include_directories(..) include_directories(..)
add_library(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) add_library(${EXECUTABLE} ${SRC_LIST} ${HEADERS})
target_include_directories(${EXECUTABLE} PUBLIC ${OpenCL_INCLUDE_DIR}) target_include_directories(${EXECUTABLE} PUBLIC ${OpenCL_INCLUDE_DIR})
target_link_libraries(${EXECUTABLE} ${OpenCL_LIBRARIES} ethash ${Boost_RANDOM_LIBRARIES} ${Boost_SYSTEM_LIBRARIES}) target_link_libraries(${EXECUTABLE} ${OpenCL_LIBRARIES} ethash)
install( TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib )
install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} )

7
libethash-cl/ethash_cl_miner.cpp

@ -31,8 +31,7 @@
#include <queue> #include <queue>
#include <vector> #include <vector>
#include <random> #include <random>
#include <boost/random/random_device.hpp> #include <random>
#include <boost/random/uniform_int_distribution.hpp>
#include <libethash/util.h> #include <libethash/util.h>
#include <libethash/ethash.h> #include <libethash/ethash.h>
#include <libethash/internal.h> #include <libethash/internal.h>
@ -472,8 +471,8 @@ void ethash_cl_miner::search(uint8_t const* header, uint64_t target, search_hook
m_searchKernel.setArg(argPos + 2, ~0u); m_searchKernel.setArg(argPos + 2, ~0u);
unsigned buf = 0; unsigned buf = 0;
boost::random_device engine; random_device engine;
uint64_t start_nonce = boost::random::uniform_int_distribution<uint64_t>()(engine); uint64_t start_nonce = uniform_int_distribution<uint64_t>()(engine);
for (;; start_nonce += m_globalWorkSize) for (;; start_nonce += m_globalWorkSize)
{ {
auto t = chrono::high_resolution_clock::now(); auto t = chrono::high_resolution_clock::now();

Loading…
Cancel
Save