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
00f51540
Commit
00f51540
authored
Jul 29, 2013
by
peastman
Browse files
Cache filename specifies whether it was compiled in 32 or 64 bit mode
parent
d7aebd3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
platforms/cuda/src/CudaContext.cpp
platforms/cuda/src/CudaContext.cpp
+2
-2
No files found.
platforms/cuda/src/CudaContext.cpp
View file @
00f51540
...
...
@@ -352,6 +352,7 @@ static bool compileInWindows(const string &command) {
#endif
CUmodule
CudaContext
::
createModule
(
const
string
source
,
const
map
<
string
,
string
>&
defines
,
const
char
*
optimizationFlags
)
{
string
bits
=
intToString
(
8
*
sizeof
(
void
*
));
string
options
=
(
optimizationFlags
==
NULL
?
defaultOptimizationOptions
:
string
(
optimizationFlags
));
stringstream
src
;
if
(
!
options
.
empty
())
...
...
@@ -411,7 +412,7 @@ CUmodule CudaContext::createModule(const string source, const map<string, string
cacheFile
.
flags
(
ios
::
hex
);
for
(
int
i
=
0
;
i
<
20
;
i
++
)
cacheFile
<<
setw
(
2
)
<<
setfill
(
'0'
)
<<
(
int
)
hash
[
i
];
cacheFile
<<
'_'
<<
gpuArchitecture
;
cacheFile
<<
'_'
<<
gpuArchitecture
<<
'_'
<<
bits
;
CUmodule
module
;
if
(
cuModuleLoad
(
&
module
,
cacheFile
.
str
().
c_str
())
==
CUDA_SUCCESS
)
return
module
;
...
...
@@ -431,7 +432,6 @@ CUmodule CudaContext::createModule(const string source, const map<string, string
ofstream
out
(
inputFile
.
c_str
());
out
<<
src
.
str
();
out
.
close
();
string
bits
=
intToString
(
8
*
sizeof
(
void
*
));
#ifdef WIN32
#ifdef _DEBUG
string
command
=
"
\"
"
+
compiler
+
"
\"
--ptx -G -g --machine "
+
bits
+
" -arch=sm_"
+
gpuArchitecture
+
" -o "
+
outputFile
+
" "
+
options
+
" "
+
inputFile
+
" 2> "
+
logFile
;
...
...
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