Skip to content

Commit

Permalink
Merge pull request ROCm#60 from AMDComputeLibraries/develop
Browse files Browse the repository at this point in the history
up2dev
  • Loading branch information
ce1adon authored Jul 18, 2018
2 parents 118c3c6 + 253b6d0 commit 205cc9d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ RUN ln -s $PREFIX /opt/rocm/hip
RUN ln -s $PREFIX /opt/rocm/hcc

# Build using hcc
RUN cget -p $PREFIX init --cxx $PREFIX/bin/hcc
RUN cget -p $PREFIX init --cxx $PREFIX/bin/hcc --std=c++14

# Install dependencies
ADD dev-requirements.txt /dev-requirements.txt
Expand Down
17 changes: 9 additions & 8 deletions src/gemm_geometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*******************************************************************************/
#include <miopen/float_equal.hpp>
#include <miopen/gemm_geometry.hpp>
#include <regex>

#if MIOPEN_USE_MIOPENGEMM
namespace miopen {
Expand All @@ -35,18 +34,20 @@ namespace miopen {
namespace tempfix {
void set_offsets_to_uint(std::string& clstr)
{
auto get_target = [](std::string inttype, char x) {
std::stringstream ss;
ss << "const " << inttype << ' ' << std::string(1, x) << "_offset";
return std::regex(ss.str());
};

for(char x : {'a', 'b', 'c'})
{
std::string replacement = "const unsigned " + std::string(1, x) + "_offset";
std::string replacement = "const unsigned " + std::string(1, x) + "_offset,";
for(auto inttype : {"size_t", "ulong"})
{
clstr = std::regex_replace(clstr, get_target(inttype, x), replacement);
std::string cmpstr =
"const " + std::string(inttype) + ' ' + std::string(1, x) + "_offset,";
auto pos = clstr.find(cmpstr);
if(pos != std::string::npos)
{
clstr.replace(pos, cmpstr.size(), replacement);
break;
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/kernels/MIOpenConvBwdWrW1x1_PAD_read4.cl
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ MIOpenCvBwdWrW_8x8map(const __global _FLOAT* __restrict top_df,
for(uint faked_off = local_Id0; faked_off < MLO_MAX_LOADS; faked_off += MLO_GRP_SZ0)
{
#if MLO_FILTER_PAD0 > 0 || MLO_FILTER_PAD1 > 0 || \
(!TWO_PASSES && (MLO_FILTER_STRIDE0 > 1 || MLO_FILTER_STRIDE1 > 1))
(!MLO_TWO_PASSES && (MLO_FILTER_STRIDE0 > 1 || MLO_FILTER_STRIDE1 > 1))

uint batch_id = faked_off / ((MLO_OUT_PAD_WIDTH / MLO_READ_UNIT) * MLO_OUT_PAD_HEIGHT);
uint faked_off2 =
Expand Down Expand Up @@ -566,7 +566,7 @@ MIOpenCvBwdWrW_16x16map(const __global _FLOAT* __restrict top_df,
faked_off += (MLO_GRP_SZ0 / 4))
{
#if MLO_FILTER_PAD0 > 0 || MLO_FILTER_PAD1 > 0 || \
(!TWO_PASSES && (MLO_FILTER_STRIDE0 > 1 || MLO_FILTER_STRIDE1 > 1))
(!MLO_TWO_PASSES && (MLO_FILTER_STRIDE0 > 1 || MLO_FILTER_STRIDE1 > 1))

#if 1 // MLO_READ_UNIT == 1
uint batch_id = faked_off / ((MLO_OUT_PAD_WIDTH / MLO_READ_UNIT) * MLO_OUT_PAD_HEIGHT);
Expand Down
18 changes: 10 additions & 8 deletions src/miopengemm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* SOFTWARE.
*
*******************************************************************************/
#include <regex>

#include <miopen/handle.hpp>
#include <miopen/miopengemm.hpp>
#include <miopen/float_equal.hpp>
Expand All @@ -38,18 +38,20 @@ namespace miopen {
namespace tempfix_v2 {
void set_offsets_to_uint(std::string& clstr)
{
auto get_target = [](std::string inttype, char x) {
std::stringstream ss;
ss << "const " << inttype << ' ' << std::string(1, x) << "_offset";
return std::regex(ss.str());
};

for(char x : {'a', 'b', 'c'})
{
std::string replacement = "const unsigned " + std::string(1, x) + "_offset";
std::string replacement = "const unsigned " + std::string(1, x) + "_offset,";
for(auto inttype : {"size_t", "ulong"})
{
clstr = std::regex_replace(clstr, get_target(inttype, x), replacement);
std::string cmpstr =
"const " + std::string(inttype) + ' ' + std::string(1, x) + "_offset,";
auto pos = clstr.find(cmpstr);
if(pos != std::string::npos)
{
clstr.replace(pos, cmpstr.size(), replacement);
break;
}
}
}
}
Expand Down

0 comments on commit 205cc9d

Please sign in to comment.