提交 62172cc1 authored 作者: Frederic Bastien's avatar Frederic Bastien

allow the lib.amdlibm flag to be on when using nvcc. We disable it for nvcc as…

allow the lib.amdlibm flag to be on when using nvcc. We disable it for nvcc as they don't work correctly together in device code.
上级 60c3bbda
...@@ -927,14 +927,25 @@ class CLinker(link.Linker): ...@@ -927,14 +927,25 @@ class CLinker(link.Linker):
try: try:
debug("LOCATION", location) debug("LOCATION", location)
c_compiler = self.c_compiler() c_compiler = self.c_compiler()
libs = self.libraries()
preargs = self.compile_args()
if c_compiler.__name__=='nvcc_module_compile_str' and config.lib.amdlibm:
#this lib don't work correctly with nvcc in device code.
if '<amdlibm.h>' in mod.includes:
mod.includes.remove('<amdlibm.h>')
if '-DREPLACE_WITH_AMDLIBM' in preargs:
preargs.remove('-DREPLACE_WITH_AMDLIBM')
if 'amdlibm' in libs:
libs.remove('amdlibm')
module = c_compiler( module = c_compiler(
module_name=mod.name, module_name=mod.name,
src_code = mod.code(), src_code = mod.code(),
location=location, location=location,
include_dirs=self.header_dirs(), include_dirs=self.header_dirs(),
lib_dirs=self.lib_dirs(), lib_dirs=self.lib_dirs(),
libs=self.libraries(), libs=libs,
preargs=self.compile_args()) preargs=preargs)
finally: finally:
release_lock() release_lock()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论