Commit 175b74bf authored by Peter Eastman's avatar Peter Eastman
Browse files

Prefer runtime compiler over nvcc

parent ca4c03c3
...@@ -132,16 +132,6 @@ CudaContext::CudaContext(const System& system, int deviceIndex, bool useBlocking ...@@ -132,16 +132,6 @@ CudaContext::CudaContext(const System& system, int deviceIndex, bool useBlocking
isNvccAvailable = (res == 0 && stat(tempDir.c_str(), &info) == 0); isNvccAvailable = (res == 0 && stat(tempDir.c_str(), &info) == 0);
int cudaDriverVersion; int cudaDriverVersion;
cuDriverGetVersion(&cudaDriverVersion); cuDriverGetVersion(&cudaDriverVersion);
static bool hasShownNvccWarning = false;
if (hasCompilerKernel && !isNvccAvailable && !hasShownNvccWarning && cudaDriverVersion < 8000) {
hasShownNvccWarning = true;
printf("Could not find nvcc. Using runtime compiler, which may produce slower performance. ");
#ifdef WIN32
printf("Set CUDA_BIN_PATH to specify where nvcc is located.\n");
#else
printf("Set OPENMM_CUDA_COMPILER to specify where nvcc is located.\n");
#endif
}
if (hostCompiler.size() > 0) if (hostCompiler.size() > 0)
this->compiler = compiler+" --compiler-bindir "+hostCompiler; this->compiler = compiler+" --compiler-bindir "+hostCompiler;
if (!hasInitializedCuda) { if (!hasInitializedCuda) {
...@@ -575,7 +565,7 @@ CUmodule CudaContext::createModule(const string source, const map<string, string ...@@ -575,7 +565,7 @@ CUmodule CudaContext::createModule(const string source, const map<string, string
// If the runtime compiler plugin is available, use it. // If the runtime compiler plugin is available, use it.
if (hasCompilerKernel && !isNvccAvailable) { if (hasCompilerKernel) {
string ptx = compilerKernel.getAs<CudaCompilerKernel>().createModule(src.str(), "-arch=compute_"+gpuArchitecture+" "+options, *this); string ptx = compilerKernel.getAs<CudaCompilerKernel>().createModule(src.str(), "-arch=compute_"+gpuArchitecture+" "+options, *this);
// If possible, write the PTX out to a temporary file so we can cache it for later use. // If possible, write the PTX out to a temporary file so we can cache it for later use.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment