Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/CMakeLists.txt b/CMakeLists.txt
- new file mode 100644
- index 0000000..58acd7c
- --- /dev/null
- +++ b/CMakeLists.txt
- @@ -0,0 +1,22 @@
- +cmake_minimum_required(VERSION 3.10)
- +project(AmoveoMinerGpuCuda LANGUAGES CUDA CXX)
- +
- +set(CMAKE_CXX_STANDARD 11)
- +
- +set(BUILD_SHARED_LIBS 0)
- +set(CPPRESTSDK_DIR ${PROJECT_BINARY_DIR}/cpprestsdk)
- +add_subdirectory(${PROJECT_SOURCE_DIR}/../cpprestsdk/Release ${CPPRESTSDK_DIR})
- +include_directories(../cpprestsdk/Release/include)
- +link_directories(${CPPRESTSDK_DIR}/Binaries)
- +
- +set_source_files_properties(main.cpp
- + PROPERTIES LANGUAGE CUDA)
- +add_executable(AmoveoMinerGpuCuda
- + base64.cpp
- + base64.h
- + main.cpp
- + poolApi.cpp
- + poolApi.h
- + sha256.cuh)
- +add_dependencies(AmoveoMinerGpuCuda cpprest)
- +target_link_libraries(AmoveoMinerGpuCuda cpprest)
- diff --git a/main.cpp b/main.cpp
- index 568dbee..fa81d44 100644
- --- a/main.cpp
- +++ b/main.cpp
- @@ -255,7 +255,7 @@ static bool getwork_thread(std::seed_seq &seed)
- gWorkData.shareDifficulty = workDataNew.shareDifficulty;
- }
- - _sleep(2000);
- + std::this_thread::sleep_for(2000ms);;
- }
- cudaFree(outCtx);
- @@ -365,7 +365,7 @@ int main(int argc, char* argv[])
- while (!gWorkData.HasNewWork())
- {
- - _sleep(100);
- + std::this_thread::sleep_for(100ms);
- }
- gWorkData.getCtx(localCtx);
- cudaMemcpy(d_ctx, localCtx, sizeof(SHA256_CTX), cudaMemcpyHostToDevice);
- diff --git a/poolApi.cpp b/poolApi.cpp
- index 807469b..30dc8b3 100644
- --- a/poolApi.cpp
- +++ b/poolApi.cpp
- @@ -87,12 +87,12 @@ void PoolApi::GetWork(string_t poolUrl, WorkData * pMinerThreadData, string mine
- // Need to use extract_vector and then convert to string and then to json
- std::vector<unsigned char> responseData = response.extract_vector().get();
- - wstring responseString(responseData.begin(), responseData.end());
- + string responseString(responseData.begin(), responseData.end());
- json::value jsonResponse = json::value::parse(responseString);
- json::array dataArray = jsonResponse.as_array();
- - wstring wBHhashBase64(dataArray[1].at(1).as_string().c_str());
- + string wBHhashBase64(dataArray[1].at(1).as_string().c_str());
- string bhashBase64(wBHhashBase64.begin(), wBHhashBase64.end());
- string bhashString = base64_decode(bhashBase64);
- vector<unsigned char> bhash(bhashString.begin(), bhashString.end());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement