Ejemplo n.º 1
0
	typename TGpuParamBuffer<Core>::BufferType TGpuParamBuffer<Core>::get() const
	{
		if (mParent == nullptr)
			return BufferType();

		return mParent->getBuffer(mParamDesc->set, mParamDesc->slot);
	}
    EnableForPointerParameter<parameterIndex> getParameter(
            const cl::Context& context) {
        using PointerType = ParameterType<parameterIndex>;
        using ValueType = typename std::remove_pointer<PointerType>::type;

        auto size = sizeof(ValueType);
        auto buffer = BufferType(context, CL_MEM_READ_WRITE, size);
        auto address = std::get<parameterIndex>(parameters);

        pointerDataList.push_back(PointerData{ buffer, size, address });

        return buffer;
    }
Ejemplo n.º 3
0
 static void call(grid<Real> const & g, BufferType & buffer)
 {
     hpx::util::high_resolution_timer timer;
     Real * data = new Real[g.ny_ * g.nz_];
     buffer = BufferType(data, g.ny_ * g.nz_, BufferType::take);
     typename BufferType::value_type * src = buffer.data();
     for(std::size_t z = 0; z != g.nz_; ++z)
     {
         for(std::size_t y = 0; y != g.ny_; ++y)
         {
             *src = g(1, y, z);
             ++src;
         }
     }
     double elapsed = timer.elapsed();
     profiling::data().time_pack_x(elapsed);
     profiling::data().time_pack(elapsed);
 }