Moisés Viñas Buceta

Start

	Bsz[0] = BLOCKSIZEX;
	Bsz[1] = BLOCKSIZEY;
	Bsz[2] = 1;

	Gsz[0] = width / Bsz[0];
	Gsz[1] = height / Bsz[1];
	Gsz[2] = 1;

	err = kernel->setArg(0, sizeof(cl::Buffer), d_out_data);
	err |= kernel->setArg(1, sizeof(cl::Buffer), d_data);
	err |= kernel->setArg(2, sizeof(unsigned int), (void*)&width);
	err |= kernel->setArg(3, sizeof(unsigned int), (void*)&height);

	if (err != CL_SUCCESS) {
		std::cout << "Error: " << err << ", in main: Kernel::setArg() failed" << std::endl;
		exit(0);
	}

	cl::NDRange global(Gsz[0]*Bsz[0], Gsz[1]*Bsz[1], Gsz[2]);
	cl::NDRange local(Bsz[0], Bsz[1], Bsz[2]);
	
	err |= commandqueue->enqueueNDRangeKernel(*kernel, cl::NullRange, global, local);

	if (err != CL_SUCCESS) {
		std::cout << "Error: " << err << ", in main: CommandQueue::enqueueNDRangeKernel() failed" << std::endl;
		exit(0);
	}