Skip to content

Commit

Permalink
Touching up on things...
Browse files Browse the repository at this point in the history
- removing accidentally committed files
- resolving merge conflicts
- adding test to build system
  • Loading branch information
hkaiser committed Jun 25, 2016
1 parent 36ec9f0 commit 34c7dc4
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 747 deletions.
35 changes: 35 additions & 0 deletions CMakeLists.txt
Expand Up @@ -990,6 +990,41 @@ hpx_check_for_cxx14_std_result_of_sfinae(
hpx_check_for_cxx_experimental_std_optional(
DEFINITIONS HPX_HAVE_CXX1Y_EXPERIMENTAL_OPTIONAL)

################################################################################
# CUDA features
################################################################################
if(HPX_WITH_CUDA AND NOT HPX_WITH_CUDA_CLANG)
hpx_libraries(cudadevrt)
if(NOT MSVC)
link_directories(${CUDA_TOOLKIT_ROOT_DIR}/lib64)
# set(CUDA_NVCC_FLAGS_DEBUG ${CUDA_NVCC_FLAGS_DEBUG};-D_DEBUG;-O0;-g;-std=c++11;-Xcompiler=-g,-O0)
# set(CUDA_NVCC_FLAGS_RELWITHDEBINFO ${CUDA_NVCC_FLAGS_RELWITHDEBINFO};-DNDEBUG;-O3;-std=c++11;-g;-Xcompiler=-g,-O3)
# set(CUDA_NVCC_FLAGS_MINSIZEREL ${CUDA_NVCC_FLAGS_MINSIZEREL};-DNDEBUG;-O1-std=c++11;;-Xcompiler=-g,-O1)
# set(CUDA_NVCC_FLAGS_RELEASE ${CUDA_NVCC_FLAGS_RELEASE};-DNDEBUG;-O3;-std=c++11;-Xcompiler=-O3)
else()
set(CUDA_PROPAGATE_HOST_FLAGS OFF)
link_directories(${CUDA_TOOLKIT_ROOT_DIR}/lib/x64)
set(CUDA_NVCC_FLAGS_DEBUG ${CUDA_NVCC_FLAGS_DEBUG};-D_DEBUG;-O0;-g;-Xcompiler=-MDd,-Od,-Zi)
set(CUDA_NVCC_FLAGS_RELWITHDEBINFO ${CUDA_NVCC_FLAGS_RELWITHDEBINFO};-DNDEBUG;-O2;-g;-Xcompiler=-MD,-O2,-Zi)
set(CUDA_NVCC_FLAGS_MINSIZEREL ${CUDA_NVCC_FLAGS_MINSIZEREL};-DNDEBUG;-O1;-Xcompiler=-MD,-O1)
set(CUDA_NVCC_FLAGS_RELEASE ${CUDA_NVCC_FLAGS_RELEASE};-DNDEBUG;-O2;-Xcompiler=-MD,-Ox)
endif()
set(CUDA_SEPARABLE_COMPILATION ON)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode=arch=compute_30,code=sm_30)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode=arch=compute_35,code=sm_35)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode=arch=compute_30,code=compute_30)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode=arch=compute_35,code=compute_35)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};--expt-relaxed-constexpr)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};--expt-extended-lambda)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-lcudadevrt)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-rdc=true)
endif()
if(HPX_WITH_CUDA AND HPX_WITH_CUDA_CLANG)
hpx_add_target_compile_option(--cuda-path=${CUDA_TOOLKIT_ROOT_DIR})
hpx_libraries(cudart)
link_directories(${CUDA_TOOLKIT_ROOT_DIR}/lib64)
endif()

################################################################################
# check for miscellaneous things
################################################################################
Expand Down
19 changes: 4 additions & 15 deletions hpx/parallel/algorithms/for_each.hpp
Expand Up @@ -22,7 +22,7 @@
#include <hpx/parallel/traits/projected.hpp>
#include <hpx/parallel/util/detail/algorithm_result.hpp>
#include <hpx/parallel/util/foreach_partitioner.hpp>
#include <hpx/parallel/util/prefetching.hpp>
#include <hpx/parallel/util/loop.hpp>
#include <hpx/parallel/util/projection_identity.hpp>

#include <algorithm>
Expand All @@ -46,9 +46,11 @@ namespace hpx { namespace parallel { HPX_INLINE_NAMESPACE(v1)
void operator()(std::size_t /*part_index*/,
Iter part_begin, std::size_t part_size)
{
typedef typename util::detail::loop_n<Iter>::type it_type;

util::loop_n(
part_begin, part_size,
[this](Iter curr) mutable
[this](it_type curr) mutable
{
hpx::util::invoke(
f_, hpx::util::invoke(proj_, *curr));
Expand Down Expand Up @@ -96,19 +98,6 @@ namespace hpx { namespace parallel { HPX_INLINE_NAMESPACE(v1)
},
[](InIter && last) -> InIter
{
typedef typename util::detail::loop_n<
InIter
>::type it_type;

// VS2015 bails out when proj or f are captured by
// ref
util::loop_n(
part_begin, part_size,
[=](it_type curr) mutable
{
hpx::util::invoke(
f, hpx::util::invoke(proj, *curr));
});
return std::move(last);
});
}
Expand Down

0 comments on commit 34c7dc4

Please sign in to comment.