Skip to content

Commit

Permalink
Merge pull request #2395 from atrantan/master
Browse files Browse the repository at this point in the history
Fix target_link_libraries() issue when HPX Cuda is enabled
  • Loading branch information
hkaiser committed Nov 17, 2016
2 parents ed55f66 + 9b258e6 commit 1eb5324
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
6 changes: 3 additions & 3 deletions hpx/compute/cuda/allocator.hpp
Expand Up @@ -184,7 +184,7 @@ namespace hpx { namespace compute { namespace cuda
::new (p + idx) T (std::forward<Args>(args)...);
}
},
p, count, std::forward<Args>(args)...);
p.device_ptr(), count, std::forward<Args>(args)...);
target_.synchronize();
}

Expand All @@ -199,7 +199,7 @@ namespace hpx { namespace compute { namespace cuda
{
::new (p) T (std::forward<Args>(args)...);
},
p, std::forward<Args>(args)...);
p.device_ptr(), std::forward<Args>(args)...);
target_.synchronize();
}

Expand All @@ -220,7 +220,7 @@ namespace hpx { namespace compute { namespace cuda
(p + idx)->~T();
}
},
p, count);
p.device_ptr(), count);
target_.synchronize();
}

Expand Down
26 changes: 18 additions & 8 deletions src/CMakeLists.txt
Expand Up @@ -218,15 +218,25 @@ else()
FOLDER "Core")
endif()

target_link_libraries(hpx
PUBLIC ${HPX_LIBRARIES})
if(HPX_ADDITIONAL_RUNTIME_DEPENDENCIES)
if(NOT HPX_WITH_CUDA) # Cuda needs plain target_link_libraries() signature
target_link_libraries(hpx
PUBLIC ${HPX_ADDITIONAL_RUNTIME_DEPENDENCIES})
endif()
if(HPX_ADDITIONAL_PRIVATE_RUNTIME_DEPENDENCIES)
target_link_libraries(hpx
PRIVATE ${HPX_ADDITIONAL_PRIVATE_RUNTIME_DEPENDENCIES})
PUBLIC ${HPX_LIBRARIES})
if(HPX_ADDITIONAL_RUNTIME_DEPENDENCIES)
target_link_libraries(hpx
PUBLIC ${HPX_ADDITIONAL_RUNTIME_DEPENDENCIES})
endif()
if(HPX_ADDITIONAL_PRIVATE_RUNTIME_DEPENDENCIES)
target_link_libraries(hpx
PRIVATE ${HPX_ADDITIONAL_PRIVATE_RUNTIME_DEPENDENCIES})
endif()
else()
target_link_libraries(hpx ${HPX_LIBRARIES})
if(HPX_ADDITIONAL_RUNTIME_DEPENDENCIES)
target_link_libraries(hpx ${HPX_ADDITIONAL_RUNTIME_DEPENDENCIES})
endif()
if(HPX_ADDITIONAL_PRIVATE_RUNTIME_DEPENDENCIES)
target_link_libraries(hpx ${HPX_ADDITIONAL_PRIVATE_RUNTIME_DEPENDENCIES})
endif()
endif()

if(HPX_WITH_APEX)
Expand Down

0 comments on commit 1eb5324

Please sign in to comment.