Commit a6e8172c authored by Paul's avatar Paul
Browse files

Formatting

parent 5aa0ba49
...@@ -7,26 +7,26 @@ ...@@ -7,26 +7,26 @@
namespace migraph { namespace migraph {
template<class T> template <class T>
struct xorshf96_generator struct xorshf96_generator
{ {
unsigned long x=123456789; unsigned long x = 123456789;
unsigned long y=362436069; unsigned long y = 362436069;
unsigned long z=521288629; unsigned long z = 521288629;
constexpr T operator()() constexpr T operator()()
{ {
unsigned long t = 0; unsigned long t = 0;
x ^= x << 16; x ^= x << 16;
x ^= x >> 5; x ^= x >> 5;
x ^= x << 1; x ^= x << 1;
t = x; t = x;
x = y; x = y;
y = z; y = z;
z = t ^ x ^ y; z = t ^ x ^ y;
return z; return z;
} }
}; };
......
...@@ -247,7 +247,7 @@ void program::compile(const target& t) ...@@ -247,7 +247,7 @@ void program::compile(const target& t)
if(enabled(MIGRAPH_TRACE_COMPILE{})) if(enabled(MIGRAPH_TRACE_COMPILE{}))
std::cout << *this << std::endl; std::cout << *this << std::endl;
#ifndef NDEBUG #ifndef NDEBUG
if(enabled(MIGRAPH_TRACE_COMPILE{})) if(enabled(MIGRAPH_TRACE_COMPILE{}))
std::cout << "Validate ..." << std::endl; std::cout << "Validate ..." << std::endl;
auto invalid = this->validate(); auto invalid = this->validate();
if(invalid != impl->instructions.end()) if(invalid != impl->instructions.end())
...@@ -256,7 +256,7 @@ void program::compile(const target& t) ...@@ -256,7 +256,7 @@ void program::compile(const target& t)
MIGRAPH_THROW(p.name() + " pass produces invalid program at instruction " + MIGRAPH_THROW(p.name() + " pass produces invalid program at instruction " +
std::to_string(index) + ": " + invalid->op.name()); std::to_string(index) + ": " + invalid->op.name());
} }
if(enabled(MIGRAPH_TRACE_COMPILE{})) if(enabled(MIGRAPH_TRACE_COMPILE{}))
std::cout << std::endl; std::cout << std::endl;
#endif #endif
} }
......
...@@ -21,14 +21,14 @@ void eliminate_workspace::apply(program& p) const ...@@ -21,14 +21,14 @@ void eliminate_workspace::apply(program& p) const
if(ins->op.name() != "hip::allocate") if(ins->op.name() != "hip::allocate")
continue; continue;
auto&& a = any_cast<hip_allocate>(ins->op); auto&& a = any_cast<hip_allocate>(ins->op);
if(a.tag == "workspace") if(a.tag == "workspace")
{ {
n = std::max(n, ins->get_shape().bytes()); n = std::max(n, ins->get_shape().bytes());
allocs.push_back(ins); allocs.push_back(ins);
} }
} }
auto ws = p.add_parameter("workspace", shape{shape::int8_type, {n}}); auto ws = p.add_parameter("workspace", shape{shape::int8_type, {n}});
for(auto&& a:allocs) for(auto&& a : allocs)
{ {
p.replace_instruction(a, ws); p.replace_instruction(a, ws);
p.remove_instruction(a); p.remove_instruction(a);
......
...@@ -125,7 +125,8 @@ struct miopen_convolution ...@@ -125,7 +125,8 @@ struct miopen_convolution
workspace_size, workspace_size,
false); false);
algo = perf.fwd_algo; algo = perf.fwd_algo;
return algo == miopenConvolutionFwdAlgoWinograd ? shape{shape::int8_type, {0}} : workspace_shape; return algo == miopenConvolutionFwdAlgoWinograd ? shape{shape::int8_type, {0}}
: workspace_shape;
} }
}; };
...@@ -332,7 +333,7 @@ struct miopen_apply ...@@ -332,7 +333,7 @@ struct miopen_apply
} }
} }
instruction_ref insert_allocation(instruction_ref ins, const shape& s, std::string tag="") instruction_ref insert_allocation(instruction_ref ins, const shape& s, std::string tag = "")
{ {
if(ins == --prog->end()) if(ins == --prog->end())
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment