From 55f467e24dd9e54268d1e4f090f974b599c20977 Mon Sep 17 00:00:00 2001 From: Peter Steinbach Date: Mon, 27 Mar 2017 14:22:56 +0200 Subject: [PATCH] moved experimental dot product implementation of dot_impl which is build only if -DHC_DEVELOP is given --- HC.make | 2 -- HCStream.cpp | 11 ++++++++++- HCStream.h | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/HC.make b/HC.make index 7a37576..1694a35 100644 --- a/HC.make +++ b/HC.make @@ -3,8 +3,6 @@ HCC = hcc - - CXXFLAGS+=-hc -stdlib=libc++ -I/opt/rocm/hcc-lc/include LDFLAGS+=-g -fstandalone-debug -hc -L/opt/rocm/hcc-lc/lib -Wl,--rpath=/opt/rocm/hcc-lc/lib -lc++ -lc++abi -ldl -Wl,--whole-archive -lmcwamp -Wl,--no-whole-archive diff --git a/HCStream.cpp b/HCStream.cpp index 4513814..659cee1 100644 --- a/HCStream.cpp +++ b/HCStream.cpp @@ -202,7 +202,7 @@ void HCStream::triad() } template -T HCStream::dot() +T HCStream::dot_impl() { //implementation adapted from @@ -280,6 +280,15 @@ T HCStream::dot() return result; } +template +T HCStream::dot() +{ + #ifdef HC_DEVELOP + return dot_impl(); + #else + return 0.; + #endif +} template class HCStream; template class HCStream; diff --git a/HCStream.h b/HCStream.h index 950b370..4bc2b18 100644 --- a/HCStream.h +++ b/HCStream.h @@ -38,6 +38,7 @@ public: virtual void mul() override; virtual void triad() override; virtual T dot() override; + T dot_impl(); virtual void init_arrays(T initA, T initB, T initC) override; virtual void read_arrays(std::vector& a, std::vector& b, std::vector& c) override;