Skip to content

Commit

Permalink
Merge pull request #19 from gangnamtestnet/windowsfn
Browse files Browse the repository at this point in the history
Use proper Windows temp dir
  • Loading branch information
jean-m-cyr authored Jan 15, 2019
2 parents 6f581ae + 4e0a72c commit 568cd9b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
13 changes: 12 additions & 1 deletion libethash-cl/CLMiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -894,8 +894,19 @@ bool CLMiner::compileKernel(
if (m_deviceDescriptor.clPlatformType == ClPlatformTypeEnum::Clover)
addDefinition(code, "LEGACY", 1);

#ifdef DEV_BUILD
ofstream write;
#if defined(_WIN32)
write.open("/temp/kernel.cl");
#else
write.open("/tmp/kernel.cl");
#endif
write << code;
write.close();
#endif

// create miner OpenCL program
cl::Program::Sources sources{{code.data(), code.size()}};
cl::Program::Sources sources{code.data()};
m_program = cl::Program(m_context, sources);
try
{
Expand Down
4 changes: 4 additions & 0 deletions libethash-cuda/CUDAMiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,11 @@ void CUDAMiner::compileKernel(
text += std::string(CUDAMiner_kernel);

ofstream write;
#if defined(_WIN32)
write.open("/temp/kernel.cu");
#else
write.open("/tmp/kernel.cu");
#endif
write << text;
write.close();

Expand Down

0 comments on commit 568cd9b

Please sign in to comment.