Commit 73339a83 authored by Paul's avatar Paul
Browse files

Formatting

parent da011b99
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
#include <rtg/program.hpp> #include <rtg/program.hpp>
namespace rtg { namespace miopen { namespace rtg {
namespace miopen {
struct miopen_target struct miopen_target
{ {
......
...@@ -3,23 +3,30 @@ ...@@ -3,23 +3,30 @@
#include <miopen/miopen.h> #include <miopen/miopen.h>
namespace rtg { namespace miopen { namespace rtg {
namespace miopen {
using miopen_handle = RTG_MANAGE_PTR(miopenHandle_t, miopenDestroy); using miopen_handle = RTG_MANAGE_PTR(miopenHandle_t, miopenDestroy);
using tensor_descriptor = RTG_MANAGE_PTR(miopenTensorDescriptor_t, miopenDestroyTensorDescriptor); using tensor_descriptor = RTG_MANAGE_PTR(miopenTensorDescriptor_t, miopenDestroyTensorDescriptor);
using convolution_descriptor = RTG_MANAGE_PTR(miopenConvolutionDescriptor_t, miopenDestroyConvolutionDescriptor); using convolution_descriptor = RTG_MANAGE_PTR(miopenConvolutionDescriptor_t,
using activation_descriptor = RTG_MANAGE_PTR(miopenActivationDescriptor_t, miopenDestroyActivationDescriptor); miopenDestroyConvolutionDescriptor);
using activation_descriptor = RTG_MANAGE_PTR(miopenActivationDescriptor_t,
miopenDestroyActivationDescriptor);
struct miopen_apply struct miopen_apply
{ {
program * prog; program* prog;
void apply() void apply()
{ {
for(auto it = prog->begin();it != prog->end();it++) { for(auto it = prog->begin(); it != prog->end(); it++)
if (it->op.name() == "convolution") { {
if(it->op.name() == "convolution")
{
apply_convolution(it); apply_convolution(it);
} else if (it->op.name() == "activation") { }
else if(it->op.name() == "activation")
{
apply_activation(it); apply_activation(it);
} }
} }
...@@ -31,22 +38,12 @@ struct miopen_apply ...@@ -31,22 +38,12 @@ struct miopen_apply
// prog->replace_instruction(ins, miopen_convolution{op}, ins->arguments); // prog->replace_instruction(ins, miopen_convolution{op}, ins->arguments);
} }
void apply_activation(instruction_ref ins) void apply_activation(instruction_ref ins) {}
{
}
}; };
std::string miopen_target::name() const std::string miopen_target::name() const { return "miopen"; }
{
return "miopen";
}
void miopen_target::apply(program& p) const void miopen_target::apply(program& p) const { miopen_apply{&p}.apply(); }
{
miopen_apply{&p}.apply();
}
} // namespace miopen } // namespace miopen
......
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