Make CUTLASS compileable with Clang.

Requires a recent clang build (r359248 or newer).

Enable compilation with clang with these options:
cmake -DCUDA_COMPILER=clang -DCMAKE_CXX_COMPILER=/path/to/clang++
This commit is contained in:
Artem Belevich
2019-05-02 11:00:22 -07:00
parent fe3438a3c1
commit e18292db46
17 changed files with 102 additions and 38 deletions
@@ -142,12 +142,17 @@ int Layout::operator()(Layout::Coordinate const &_coord) const {
}
// test::Layout::Coordinate is actually a std::vector<>, so for ADL lookup to
// work, the operator<< must be in std::. GCC does look it up in global
// namespace, but that's a bug.
namespace std {
std::ostream & operator<<(std::ostream &out, test::Layout::Coordinate const &coord) {
for (int i = 0; i < coord.size(); ++i) {
out << (i ? ", " : "") << coord.at(i);
}
return out;
}
} // namespace std
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -94,7 +94,9 @@ class Layout {
}
/// Implemented in layout_verification.cu
namespace std {
std::ostream& operator<<(std::ostream& out, test::Layout::Coordinate const& coord);
}
namespace test {
+1 -3
View File
@@ -42,9 +42,7 @@ __global__ void load_store_global(
typename cutlass::TileStoreIterator<Traits, Scalar, cutlass::IteratorAdvance::kH,
cutlass::MemorySpace::kGlobal>::Scalar *output,
int kW,
int kH,
typename cutlass::TileStoreIterator<Traits, Scalar, cutlass::IteratorAdvance::kH,
cutlass::MemorySpace::kGlobal>::Scalar identity = 0
int kH
) {
/// Load iterator