Commit 735e102a authored by Paul's avatar Paul
Browse files

Formatting

parent e63c09c5
......@@ -12,7 +12,7 @@ struct index
std::size_t group;
};
template<class F>
template <class F>
__global__ void launcher(F f)
{
index idx{blockIdx.x * blockDim.x + threadIdx.x, threadIdx.x, blockIdx.x};
......@@ -27,12 +27,7 @@ auto launch(std::size_t global, std::size_t local)
using f_type = decltype(f);
dim3 nblocks(global / local);
dim3 nthreads(local);
hipLaunchKernelGGL((launcher<f_type>),
nblocks,
nthreads,
0,
nullptr,
f);
hipLaunchKernelGGL((launcher<f_type>), nblocks, nthreads, 0, nullptr, f);
};
}
......@@ -139,7 +134,7 @@ void hip_contiguous(migraph::shape output_shape, migraph::argument arg, migraph:
auto* at = output.data();
auto nelements = s.elements();
std::size_t nlocal = 512;
std::size_t nglobal = 512*nlocal;
std::size_t nglobal = 512 * nlocal;
launch(nglobal, nlocal)([=](auto idx) mutable {
for(size_t i = idx.global; i < nelements; i += nglobal)
......
......@@ -17,17 +17,12 @@
struct auto_eval
{
migraph::program* p;
migraph::program::parameter_map * m;
migraph::program::parameter_map* m;
migraph::argument result;
auto_eval(migraph::program& pp, migraph::program::parameter_map& pm)
: p(&pp), m(&pm)
{}
auto_eval(migraph::program& pp, migraph::program::parameter_map& pm) : p(&pp), m(&pm) {}
migraph::argument operator()() const
{
return p->eval(*m);
}
migraph::argument operator()() const { return p->eval(*m); }
~auto_eval()
{
......
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