Commit a6e8172c authored by Paul's avatar Paul
Browse files

Formatting

parent 5aa0ba49
......@@ -7,26 +7,26 @@
namespace migraph {
template<class T>
template <class T>
struct xorshf96_generator
{
unsigned long x=123456789;
unsigned long y=362436069;
unsigned long z=521288629;
unsigned long x = 123456789;
unsigned long y = 362436069;
unsigned long z = 521288629;
constexpr T operator()()
{
unsigned long t = 0;
x ^= x << 16;
x ^= x >> 5;
x ^= x << 1;
x ^= x << 16;
x ^= x >> 5;
x ^= x << 1;
t = x;
x = y;
y = z;
z = t ^ x ^ y;
t = x;
x = y;
y = z;
z = t ^ x ^ y;
return z;
return z;
}
};
......
......@@ -247,7 +247,7 @@ void program::compile(const target& t)
if(enabled(MIGRAPH_TRACE_COMPILE{}))
std::cout << *this << std::endl;
#ifndef NDEBUG
if(enabled(MIGRAPH_TRACE_COMPILE{}))
if(enabled(MIGRAPH_TRACE_COMPILE{}))
std::cout << "Validate ..." << std::endl;
auto invalid = this->validate();
if(invalid != impl->instructions.end())
......@@ -256,7 +256,7 @@ void program::compile(const target& t)
MIGRAPH_THROW(p.name() + " pass produces invalid program at instruction " +
std::to_string(index) + ": " + invalid->op.name());
}
if(enabled(MIGRAPH_TRACE_COMPILE{}))
if(enabled(MIGRAPH_TRACE_COMPILE{}))
std::cout << std::endl;
#endif
}
......
......@@ -21,14 +21,14 @@ void eliminate_workspace::apply(program& p) const
if(ins->op.name() != "hip::allocate")
continue;
auto&& a = any_cast<hip_allocate>(ins->op);
if(a.tag == "workspace")
if(a.tag == "workspace")
{
n = std::max(n, ins->get_shape().bytes());
allocs.push_back(ins);
}
}
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.remove_instruction(a);
......
......@@ -125,7 +125,8 @@ struct miopen_convolution
workspace_size,
false);
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
}
}
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())
{
......
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