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
c7e1b591
Commit
c7e1b591
authored
Feb 25, 2013
by
Peter Eastman
Browse files
Compile device code in 32 or 64 bit mode to match the host code (see bug 1811).
parent
475ccb4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
platforms/cuda/src/CudaContext.cpp
platforms/cuda/src/CudaContext.cpp
+3
-2
No files found.
platforms/cuda/src/CudaContext.cpp
View file @
c7e1b591
...
...
@@ -366,10 +366,11 @@ 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
string
command
=
""
+
compiler
+
" --ptx --machine
32
-arch=sm_"
+
gpuArchitecture
+
" -o "
+
outputFile
+
" "
+
options
+
" "
+
inputFile
+
" 2> "
+
logFile
;
string
command
=
""
+
compiler
+
" --ptx --machine
"
+
bits
+
"
-arch=sm_"
+
gpuArchitecture
+
" -o "
+
outputFile
+
" "
+
options
+
" "
+
inputFile
+
" 2> "
+
logFile
;
#else
string
command
=
"
\"
"
+
compiler
+
"
\"
--ptx -arch=sm_"
+
gpuArchitecture
+
" -o
\"
"
+
outputFile
+
"
\"
"
+
options
+
"
\"
"
+
inputFile
+
"
\"
2>
\"
"
+
logFile
+
"
\"
"
;
string
command
=
"
\"
"
+
compiler
+
"
\"
--ptx
--machine "
+
bits
+
"
-arch=sm_"
+
gpuArchitecture
+
" -o
\"
"
+
outputFile
+
"
\"
"
+
options
+
"
\"
"
+
inputFile
+
"
\"
2>
\"
"
+
logFile
+
"
\"
"
;
#endif
int
res
=
std
::
system
(
command
.
c_str
());
try
{
...
...
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