Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
bf34e947
Commit
bf34e947
authored
Jul 30, 2013
by
peastman
Browse files
Can set OPENMM_CACHE_DIR to specify where PTX files should be cached
parent
50eb44c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
platforms/cuda/include/CudaContext.h
platforms/cuda/include/CudaContext.h
+1
-1
platforms/cuda/src/CudaContext.cpp
platforms/cuda/src/CudaContext.cpp
+5
-1
No files found.
platforms/cuda/include/CudaContext.h
View file @
bf34e947
...
...
@@ -515,7 +515,7 @@ private:
int
numAtomBlocks
;
int
numThreadBlocks
;
bool
useBlockingSync
,
useDoublePrecision
,
useMixedPrecision
,
contextIsValid
,
atomsWereReordered
;
std
::
string
compiler
,
tempDir
,
gpuArchitecture
;
std
::
string
compiler
,
tempDir
,
cacheDir
,
gpuArchitecture
;
float4
periodicBoxSizeFloat
,
invPeriodicBoxSizeFloat
;
double4
periodicBoxSize
,
invPeriodicBoxSize
;
std
::
string
defaultOptimizationOptions
;
...
...
platforms/cuda/src/CudaContext.cpp
View file @
bf34e947
...
...
@@ -92,10 +92,14 @@ CudaContext::CudaContext(const System& system, int deviceIndex, bool useBlocking
}
else
throw
OpenMMException
(
"Illegal value for CudaPrecision: "
+
precision
);
char
*
cacheVariable
=
getenv
(
"OPENMM_CACHE_DIR"
);
cacheDir
=
(
cacheVariable
==
NULL
?
tempDir
:
string
(
cacheVariable
));
#ifdef WIN32
this
->
tempDir
=
tempDir
+
"
\\
"
;
cacheDir
=
cacheDir
+
"
\\
"
;
#else
this
->
tempDir
=
tempDir
+
"/"
;
cacheDir
=
cacheDir
+
"/"
;
#endif
contextIndex
=
platformData
.
contexts
.
size
();
int
numDevices
;
...
...
@@ -408,7 +412,7 @@ CUmodule CudaContext::createModule(const string source, const map<string, string
UINT_8
hash
[
20
];
sha1
.
GetHash
(
hash
);
stringstream
cacheFile
;
cacheFile
<<
temp
Dir
;
cacheFile
<<
cache
Dir
;
cacheFile
.
flags
(
ios
::
hex
);
for
(
int
i
=
0
;
i
<
20
;
i
++
)
cacheFile
<<
setw
(
2
)
<<
setfill
(
'0'
)
<<
(
int
)
hash
[
i
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment