Browse Source

Don't read kernel file as string during runtime

cl-refactor
Lefteris Karapetsas 10 years ago
parent
commit
c6020f6625
  1. 6
      libethash-cl/ethash_cl_miner.cpp

6
libethash-cl/ethash_cl_miner.cpp

@ -233,9 +233,9 @@ bool ethash_cl_miner::init(
m_workgroup_size = ((workgroup_size + 7) / 8) * 8;
// patch source code
std::ifstream t("ethash_cl_miner_kernel.cl");
std::string code((std::istreambuf_iterator<char>(t)),
std::istreambuf_iterator<char>());
// note: ETHASH_CL_MINER_KERNEL is simply ethash_cl_miner_kernel.cl compiled
// into a byte array by bin2h.cmake. There is no need to load the file by hand in runtime
std::string code(ETHASH_CL_MINER_KERNEL, ETHASH_CL_MINER_KERNEL + ETHASH_CL_MINER_KERNEL_SIZE);
add_definition(code, "GROUP_SIZE", m_workgroup_size);
add_definition(code, "DAG_SIZE", (unsigned)(_dagSize / ETHASH_MIX_BYTES));
add_definition(code, "ACCESSES", ETHASH_ACCESSES);

Loading…
Cancel
Save