!!!Bitte folgende Stellen einfärben: !!! Zeile 3: try !!! Zeile 8: cl::Kernel !!! Zeile 12: CL_TRUE, target_buffer und black_target !!! Zeile 15: source_buffer !!! Zeile 20: queu.enqueueNDRangeKernel, cl::NDRange(dimX, dimY), &event !!! Zeile 24: target_buffer !!! Zeile 26: PPM-Format !!! Zeile 36: catch !!!Listing 4: Hier findet die Kommunikation mit der GPU statt 1 std::string LogoRotate::rotate(const float& angle) 2 { 3 try{ 4 // Will hold the final image 5 std::ostringstream result; 6 7 // Create a suitable kernel 8 rotate_kernel = cl::Kernel(program, "logo_rotate"); 9 10 // Re-initialize the black target image on the GPU. The call will 11 // only return after all data has been copied, due to the second argument. 12 queue.enqueueWriteBuffer(target_buffer, CL_TRUE, 0, sizeof(cl_uchar4)*dimX*dimY, (void *)black_target); 13 14 //set the arguments of our kernel 15 rotate_kernel.setArg(0, source_buffer); 16 rotate_kernel.setArg(1, target_buffer); 17 rotate_kernel.setArg(2, (cl_float)angle); 18 19 // Execute the kernel and wait for its termination 20 queue.enqueueNDRangeKernel(rotate_kernel, cl::NullRange, cl::NDRange(dimX, dimY), cl::NullRange, NULL, &event); 21 event.wait(); 22 23 // Retrieve the results buffer 24 queue.enqueueReadBuffer(target_buffer, CL_TRUE, 0, sizeof(cl_uchar4)*dimX*dimY, target); 25 26 // Assemble the image in PPM format 27 result 28 << "P3" << std::endl 29 << dimX << " " << dimY << std::endl 30 << 255 << std::endl; 31 for(int i=0; i