Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Simplify usage of namespace macros, add thrust compatibility. #326

Merged
merged 1 commit into from
Jul 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cmake/CubHeaderTesting.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ foreach(cub_target IN LISTS CUB_TARGETS)
set(headertest_target ${config_prefix}.headers)
add_library(${headertest_target} OBJECT ${headertest_srcs})
target_link_libraries(${headertest_target} PUBLIC ${cub_target})
# Wrap Thrust/CUB in a custom namespace to check proper use of ns macros:
target_compile_definitions(${headertest_target} PRIVATE
"THRUST_WRAPPED_NAMESPACE=wrapped_thrust"
"CUB_WRAPPED_NAMESPACE=wrapped_cub"
)
cub_clone_target_properties(${headertest_target} ${cub_target})

add_dependencies(cub.all.headers ${headertest_target})
Expand Down
13 changes: 2 additions & 11 deletions cub/agent/agent_histogram.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@
#include "../grid/grid_queue.cuh"
#include "../iterator/cache_modified_input_iterator.cuh"

/// Optional outer namespace(s)
CUB_NS_PREFIX

/// CUB namespace
namespace cub {
CUB_NAMESPACE_BEGIN


/******************************************************************************
Expand Down Expand Up @@ -779,9 +775,4 @@ struct AgentHistogram

};




} // CUB namespace
CUB_NS_POSTFIX // Optional outer namespace(s)

CUB_NAMESPACE_END
9 changes: 2 additions & 7 deletions cub/agent/agent_radix_sort_downsweep.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@
#include "../util_type.cuh"
#include "../iterator/cache_modified_input_iterator.cuh"

/// Optional outer namespace(s)
CUB_NS_PREFIX

/// CUB namespace
namespace cub {
CUB_NAMESPACE_BEGIN


/******************************************************************************
Expand Down Expand Up @@ -777,6 +773,5 @@ struct AgentRadixSortDownsweep



} // CUB namespace
CUB_NS_POSTFIX // Optional outer namespace(s)
CUB_NAMESPACE_END

9 changes: 2 additions & 7 deletions cub/agent/agent_radix_sort_histogram.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@
#include "../util_type.cuh"


/// Optional outer namespace(s)
CUB_NS_PREFIX

/// CUB namespace
namespace cub {
CUB_NAMESPACE_BEGIN

template <
int _BLOCK_THREADS,
Expand Down Expand Up @@ -237,5 +233,4 @@ struct AgentRadixSortHistogram
}
};

} // CUB namespace
CUB_NS_POSTFIX // Optional outer namespace(s)
CUB_NAMESPACE_END
9 changes: 2 additions & 7 deletions cub/agent/agent_radix_sort_onesweep.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@
#include "../util_ptx.cuh"
#include "../util_type.cuh"

/// Optional outer namespace(s)
CUB_NS_PREFIX

/// CUB namespace
namespace cub {
CUB_NAMESPACE_BEGIN

/** \brief cub::RadixSortStoreAlgorithm enumerates different algorithms to write
* partitioned elements (keys, values) stored in shared memory into global
Expand Down Expand Up @@ -662,5 +658,4 @@ struct AgentRadixSortOnesweep
}
};

} // CUB namespace
CUB_NS_POSTFIX // Optional outer namespace(s)
CUB_NAMESPACE_END
9 changes: 2 additions & 7 deletions cub/agent/agent_radix_sort_upsweep.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@
#include "../util_type.cuh"
#include "../iterator/cache_modified_input_iterator.cuh"

/// Optional outer namespace(s)
CUB_NS_PREFIX

/// CUB namespace
namespace cub {
CUB_NAMESPACE_BEGIN

/******************************************************************************
* Tuning policy types
Expand Down Expand Up @@ -521,6 +517,5 @@ struct AgentRadixSortUpsweep
};


} // CUB namespace
CUB_NS_POSTFIX // Optional outer namespace(s)
CUB_NAMESPACE_END

9 changes: 2 additions & 7 deletions cub/agent/agent_reduce.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@
#include "../iterator/cache_modified_input_iterator.cuh"


/// Optional outer namespace(s)
CUB_NS_PREFIX

/// CUB namespace
namespace cub {
CUB_NAMESPACE_BEGIN


/******************************************************************************
Expand Down Expand Up @@ -381,6 +377,5 @@ struct AgentReduce
};


} // CUB namespace
CUB_NS_POSTFIX // Optional outer namespace(s)
CUB_NAMESPACE_END

9 changes: 2 additions & 7 deletions cub/agent/agent_reduce_by_key.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@
#include "../iterator/cache_modified_input_iterator.cuh"
#include "../iterator/constant_input_iterator.cuh"

/// Optional outer namespace(s)
CUB_NS_PREFIX

/// CUB namespace
namespace cub {
CUB_NAMESPACE_BEGIN


/******************************************************************************
Expand Down Expand Up @@ -542,6 +538,5 @@ struct AgentReduceByKey
};


} // CUB namespace
CUB_NS_POSTFIX // Optional outer namespace(s)
CUB_NAMESPACE_END

9 changes: 2 additions & 7 deletions cub/agent/agent_rle.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@
#include "../iterator/cache_modified_input_iterator.cuh"
#include "../iterator/constant_input_iterator.cuh"

/// Optional outer namespace(s)
CUB_NS_PREFIX

/// CUB namespace
namespace cub {
CUB_NAMESPACE_BEGIN


/******************************************************************************
Expand Down Expand Up @@ -832,6 +828,5 @@ struct AgentRle
};


} // CUB namespace
CUB_NS_POSTFIX // Optional outer namespace(s)
CUB_NAMESPACE_END

9 changes: 2 additions & 7 deletions cub/agent/agent_scan.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@
#include "../grid/grid_queue.cuh"
#include "../iterator/cache_modified_input_iterator.cuh"

/// Optional outer namespace(s)
CUB_NS_PREFIX

/// CUB namespace
namespace cub {
CUB_NAMESPACE_BEGIN


/******************************************************************************
Expand Down Expand Up @@ -485,6 +481,5 @@ struct AgentScan
};


} // CUB namespace
CUB_NS_POSTFIX // Optional outer namespace(s)
CUB_NAMESPACE_END

9 changes: 2 additions & 7 deletions cub/agent/agent_segment_fixup.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@
#include "../iterator/cache_modified_input_iterator.cuh"
#include "../iterator/constant_input_iterator.cuh"

/// Optional outer namespace(s)
CUB_NS_PREFIX

/// CUB namespace
namespace cub {
CUB_NAMESPACE_BEGIN


/******************************************************************************
Expand Down Expand Up @@ -370,6 +366,5 @@ struct AgentSegmentFixup
};


} // CUB namespace
CUB_NS_POSTFIX // Optional outer namespace(s)
CUB_NAMESPACE_END

9 changes: 2 additions & 7 deletions cub/agent/agent_select_if.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@
#include "../grid/grid_queue.cuh"
#include "../iterator/cache_modified_input_iterator.cuh"

/// Optional outer namespace(s)
CUB_NS_PREFIX

/// CUB namespace
namespace cub {
CUB_NAMESPACE_BEGIN


/******************************************************************************
Expand Down Expand Up @@ -698,6 +694,5 @@ struct AgentSelectIf



} // CUB namespace
CUB_NS_POSTFIX // Optional outer namespace(s)
CUB_NAMESPACE_END

9 changes: 2 additions & 7 deletions cub/agent/agent_spmv_orig.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@
#include "../iterator/counting_input_iterator.cuh"
#include "../iterator/tex_obj_input_iterator.cuh"

/// Optional outer namespace(s)
CUB_NS_PREFIX

/// CUB namespace
namespace cub {
CUB_NAMESPACE_BEGIN


/******************************************************************************
Expand Down Expand Up @@ -665,6 +661,5 @@ struct AgentSpmv



} // CUB namespace
CUB_NS_POSTFIX // Optional outer namespace(s)
CUB_NAMESPACE_END

9 changes: 2 additions & 7 deletions cub/agent/single_pass_scan_operators.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@
#include "../config.cuh"
#include "../util_device.cuh"

/// Optional outer namespace(s)
CUB_NS_PREFIX

/// CUB namespace
namespace cub {
CUB_NAMESPACE_BEGIN


/******************************************************************************
Expand Down Expand Up @@ -809,6 +805,5 @@ struct TilePrefixCallbackOp
};


} // CUB namespace
CUB_NS_POSTFIX // Optional outer namespace(s)
CUB_NAMESPACE_END

9 changes: 2 additions & 7 deletions cub/block/block_adjacent_difference.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@
#include "../util_type.cuh"
#include "../util_ptx.cuh"

/// Optional outer namespace(s)
CUB_NS_PREFIX

/// CUB namespace
namespace cub {
CUB_NAMESPACE_BEGIN

template <
typename T,
Expand Down Expand Up @@ -592,5 +588,4 @@ public:
};


} // CUB namespace
CUB_NS_POSTFIX // Optional outer namespace(s)
CUB_NAMESPACE_END
9 changes: 2 additions & 7 deletions cub/block/block_discontinuity.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@
#include "../util_type.cuh"
#include "../util_ptx.cuh"

/// Optional outer namespace(s)
CUB_NS_PREFIX

/// CUB namespace
namespace cub {
CUB_NAMESPACE_BEGIN

/**
* \brief The BlockDiscontinuity class provides [<em>collective</em>](index.html#sec0) methods for flagging discontinuities within an ordered set of items partitioned across a CUDA thread block. ![](discont_logo.png)
Expand Down Expand Up @@ -1144,5 +1140,4 @@ public:
};


} // CUB namespace
CUB_NS_POSTFIX // Optional outer namespace(s)
CUB_NAMESPACE_END
9 changes: 2 additions & 7 deletions cub/block/block_exchange.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@
#include "../util_ptx.cuh"
#include "../util_type.cuh"

/// Optional outer namespace(s)
CUB_NS_PREFIX

/// CUB namespace
namespace cub {
CUB_NAMESPACE_BEGIN

/**
* \brief The BlockExchange class provides [<em>collective</em>](index.html#sec0) methods for rearranging data partitioned across a CUDA thread block. ![](transpose_logo.png)
Expand Down Expand Up @@ -1241,6 +1237,5 @@ public:



} // CUB namespace
CUB_NS_POSTFIX // Optional outer namespace(s)
CUB_NAMESPACE_END

9 changes: 2 additions & 7 deletions cub/block/block_histogram.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@
#include "../config.cuh"
#include "../util_ptx.cuh"

/// Optional outer namespace(s)
CUB_NS_PREFIX

/// CUB namespace
namespace cub {
CUB_NAMESPACE_BEGIN


/******************************************************************************
Expand Down Expand Up @@ -409,6 +405,5 @@ public:

};

} // CUB namespace
CUB_NS_POSTFIX // Optional outer namespace(s)
CUB_NAMESPACE_END

9 changes: 2 additions & 7 deletions cub/block/block_load.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@
#include "../util_ptx.cuh"
#include "../util_type.cuh"

/// Optional outer namespace(s)
CUB_NS_PREFIX

/// CUB namespace
namespace cub {
CUB_NAMESPACE_BEGIN

/**
* \addtogroup UtilIo
Expand Down Expand Up @@ -1289,6 +1285,5 @@ public:
};


} // CUB namespace
CUB_NS_POSTFIX // Optional outer namespace(s)
CUB_NAMESPACE_END

Loading