本文整理汇总了C++中int2::Pro方法的典型用法代码示例。如果您正苦于以下问题:C++ int2::Pro方法的具体用法?C++ int2::Pro怎么用?C++ int2::Pro使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类int2
的用法示例。
在下文中一共展示了int2::Pro方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[]) {
const int2 videoSize = int2(1280, 720);
const cl_uint maxDevices = 8;
cl_device_id computeDevices[maxDevices];
cl_context context = NULL;
cl_command_queue commandQueue = NULL;
initOpenCL(computeDevices, maxDevices, context, commandQueue);
checkCLerror(__LINE__, __FILE__);
cl_program program;
vector<const char*> paths = {"03_sharedWithCL.h", "UIshader.cl"};
initClProgram(paths, program, context, computeDevices);
checkCLerror(__LINE__, __FILE__);
cl_kernel kernel = clCreateKernel(program, "UIshader", &CLstatus);
checkCLerror(__LINE__, __FILE__);
cl_mem outputImage;
{
cl_image_format outputImageFormat = {CL_RGBA, CL_UNORM_INT8};
cl_image_desc outputImageDesc;
memset(&outputImageDesc, '\0', sizeof(cl_image_desc));
outputImageDesc.image_type = CL_MEM_OBJECT_IMAGE2D;
outputImageDesc.image_width = videoSize.x;
outputImageDesc.image_height = videoSize.y;
outputImage = clCreateImage(
context, //cl_context context,
CL_MEM_WRITE_ONLY, //cl_mem_flags flags,
&outputImageFormat, //const cl_image_format *image_format,
&outputImageDesc, //const cl_image_desc *image_desc,
NULL, //void *host_ptr,
&CLstatus //cl_int *errcode_ret
);
checkCLerror(__LINE__, __FILE__);
}
initGlyphSheet("glyphSheets/hermit_010_023");
{
cl_image_format glyphSheetFormat = {CL_LUMINANCE, CL_UNORM_INT8};
cl_image_desc glyphSheetDesc;
memset(&glyphSheetDesc, '\0', sizeof(cl_image_desc));
glyphSheetDesc.image_type = CL_MEM_OBJECT_IMAGE2D;
glyphSheetDesc.image_width = gss->w;
glyphSheetDesc.image_height = gss->h;
glyphSheet = clCreateImage(
context, //cl_context context,
CL_MEM_READ_ONLY, //cl_mem_flags flags,
&glyphSheetFormat, //const cl_image_format *image_format,
&glyphSheetDesc, //const cl_image_desc *image_desc,
NULL, //void *host_ptr,
&CLstatus //cl_int *errcode_ret
);
checkCLerror(__LINE__, __FILE__);
}
{
size_t origin[] = {0,0,0};
size_t region[] = {(size_t)gss->w, (size_t)gss->h, 1};
CLstatus = clEnqueueWriteImage(
commandQueue, //cl_command_queue command_queue,
glyphSheet, //cl_mem image,
CL_TRUE, //cl_bool blocking_write,
&origin[0], //const size_t *origin,
®ion[0], //const size_t *region,
gss->w, //size_t input_row_pitch,
0, //size_t input_slice_pitch,
gss->pixels, //const void *ptr,
0, //cl_uint num_events_in_wait_list,
NULL, //const cl_event *event_wait_list,
NULL //cl_event *event
);
checkCLerror(__LINE__, __FILE__);
}
buildsomeroots();
size_t UItextSize = sizeof(int) * UItextBlock.size.pro();
cl_mem UItext_clmem = clCreateBuffer(
context,
CL_MEM_READ_ONLY,
UItextSize,
NULL,
&CLstatus
);
checkCLerror(__LINE__, __FILE__);
CLstatus = clEnqueueWriteBuffer (
commandQueue, //cl_command_queue command_queue,
UItext_clmem, //cl_mem buffer,
CL_TRUE, //cl_bool blocking_write,
0, //size_t offset,
UItextSize, //size_t cb,
(void*)UItextBlock.text.data(), //const void *ptr,
0, //cl_uint num_events_in_wait_list,
NULL, //const cl_event *event_wait_list,
NULL //cl_event *event
);
checkCLerror(__LINE__, __FILE__);
cl_mem gsi_clmem = clCreateBuffer(
context,
CL_MEM_READ_ONLY,
//.........这里部分代码省略.........