OpenCL™规范 5.8.1. 创建程序对象

采样点不一致真会导致整车网络瘫痪?用VH6501实测给你看 本文通过VH6501硬件干扰仪实测分析采样点偏差对整车CAN网络的影响,揭示微秒级时间偏移如何导致通信系统瘫痪。文章详细解析了采样点一致性的重要性、测试方法及解决方案,为车载网络可靠性提供实践指导。 阅读详情
5.8.1. Creating Program Objects
5.8.1. 创建程序对象

To creates a program object for a context and load source code into that object, call the function

要为上下文创建程序对象并将源代码加载到该对象中,请调用函数

// Provided by CL_VERSION_1_0
cl_program clCreateProgramWithSource(
    cl_context context,
    cl_uint count,
    const char** strings,
    const size_t* lengths,
    cl_int* errcode_ret);
  • context must be a valid OpenCL context.

  • context必须是有效的OpenCL上下文。

  • strings is an array of count pointers to optionally null-terminated character strings that make up the source code.

  • strings是一个计数指针数组,指向构成源代码的可选以null结尾的字符串。

  • lengths argument is an array with the number of chars in each string (the string length). If an element in lengths is zero, its accompanying string is null-terminated. If lengths is NULL, all strings in the strings argument are considered null-terminated. Any length value passed in that is greater than zero excludes the null terminator in its count.

  • lengths参数是一个数组,其中包含每个字符串中的字符数(字符串长度)。如果长度为零的元素,则其附带的字符串以null结尾。如果lengths为NULL,则字符串参数中的所有字符串都被视为以NULL结尾。传入的任何大于零的长度值都会在其计数中排除空终止符。

  • errcode_ret will return an appropriate error code. If errcode_ret is NULL, no error code is returned.

  • errcode_ret将返回适当的错误代码。如果errcode_ret为NULL,则不返回错误代码。

The source code specified by strings will be loaded into the program object.

由strings指定的源代码将被加载到程序对象中。

The devices associated with the program object are the devices associated with context. The source code specified by strings is either an OpenCL C program source, header or implementation-defined source for custom devices that support an online compiler. OpenCL C++ is not supported as an online-compiled kernel language through this interface.

与程序对象关联的设备是与context关联的设备。由字符串指定的源代码是OpenCL C程序源代码、头文件或支持在线编译器的自定义设备的实现定义源代码。OpenCL C++不支持通过此接口作为在线编译的内核语言。

clCreateProgramWithSource returns a valid non-zero program object and errcode_ret is set to CL_SUCCESS if the program object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in errcode_ret:

clCreateProgramWithSource返回一个有效的非零程序对象,如果程序对象创建成功,则errcode_ret设置为CL_SUCCESS。否则,它将返回一个NULL值,并在errcode_ret中返回以下错误值之一:

  • CL_INVALID_CONTEXT if context is not a valid context.

  • 如果context不是有效的上下文,则返回CL_INVALID_CONTEXT。

  • CL_INVALID_VALUE if count is zero or if strings or any entry in strings is NULL.

  • 如果count为零或strings或strings中的任何条目为NULL,则返回CL_INVALID_VALUE。

  • CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.

  • CL_OUT_OF_RESOURCES,如果无法在设备上分配OpenCL实现所需的资源。

  • CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.

  • CL_OUT_OF_HOST_MEMORY,如果无法在主机上分配OpenCL实现所需的资源。

To create a program object for a context and load code in an intermediate language into that object, call the function

要为上下文创建程序对象并将中间语言的代码加载到该对象中,请调用函数

// Provided by CL_VERSION_2_1
cl_program clCreateProgramWithIL(
    cl_context context,
    const void* il,
    size_t length,
    cl_int* errcode_ret);

clCreateProgramWithIL is missing before version 2.1.

2.1版本之前缺少clCreateProgramWithIL。

or the equivalent

或等效函数

// Provided by cl_khr_il_program
cl_program clCreateProgramWithILKHR(
    cl_context context,
    const void* il,
    size_t length,
    cl_int* errcode_ret);

clCreateProgramWithILKHR is provided by the cl_khr_il_program extension.

clCreateProgramWithILKHR由cl_khr_il_program扩展提供。

  • context must be a valid OpenCL context.

  • context必须是有效的OpenCL上下文。

  • il is a pointer to a block of memory containing SPIR-V or an implementation-defined intermediate language.

  • il是指向包含SPIR-V或实现定义的中间语言的内存块的指针。

  • length is the length of the block pointed to by il.

  • length是il指向的块的长度。

  • errcode_ret will return an appropriate error code. If errcode_ret is NULL, no error code is returned.

  • errcode_ret将返回适当的错误代码。如果errcode_ret为NULL,则不返回错误代码。

The intermediate language pointed to by il and with length in bytes length will be loaded into the program object. The devices associated with the program object are the devices associated with context.

由il指向的中间语言,其长度以字节为单位,将被加载到程序对象中。与程序对象关联的设备是与context关联的设备。

clCreateProgramWithIL returns a valid non-zero program object and errcode_ret is set to CL_SUCCESS if the program object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in errcode_ret:

clCreateProgramWithIL返回一个有效的非零程序对象,如果程序对象创建成功,则errcode_ret设置为CL_SUCCESS。否则,它将返回一个NULL值,并在errcode_ret中返回以下错误值之一:

  • CL_INVALID_CONTEXT if context is not a valid context.

  • 如果context不是有效的上下文,则返回CL_INVALID_CONTEXT。

  • CL_INVALID_OPERATION if no devices in context support intermediate language programs.

  • CL_INVALID_OPERATION(如果context中没有设备支持中间语言程序)。

  • CL_INVALID_VALUE if il is NULL or if length is zero.

  • 如果il为NULL或长度为零,则为CL_INVALID_VALUE。

  • CL_INVALID_VALUE if the length-byte block of memory pointed to by il does not contain well-formed intermediate language input that can be consumed by the OpenCL runtime.

  • CL_INVALID_VALUE,如果il指向的内存长度字节块不包含OpenCL运行时可以使用的格式良好的中间语言输入。

  • CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.

  • CL_OUT_OF_RESOURCES,如果无法在设备上分配OpenCL实现所需的资源。

  • CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.

  • CL_OUT_OF_HOST_MEMORY,如果无法在主机上分配OpenCL实现所需的资源。

To create a program object for a context and load binary bits into that object, call the function

要为上下文创建程序对象并将二进制位加载到该对象中,请调用函数

// Provided by CL_VERSION_1_0
cl_program clCreateProgramWithBinary(
    cl_context context,
    cl_uint num_devices,
    const cl_device_id* device_list,
    const size_t* lengths,
    const unsigned char** binaries,
    cl_int* binary_status,
    cl_int* errcode_ret);
  • context must be a valid OpenCL context.

  • context必须是有效的OpenCL上下文。

  • device_list is a pointer to a list of devices that are in context. device_list must be a non-NULL value. The binaries are loaded for devices specified in this list.

  • device_list是指向context中设备列表的指针。device_list必须是非NULL值。为此列表中指定的设备加载二进制文件。

  • num_devices is the number of devices listed in device_list.

  • num_devices是device_list中列出的设备数量。

  • lengths is an array of the size in bytes of the program binaries to be loaded for devices specified by device_list.

  • lengths是一个数组,表示要为devicelist指定的设备加载的程序二进制文件的字节大小。

  • binaries is an array of pointers to program binaries to be loaded for devices specified by device_list. For each device given by device_list[i], the pointer to the program binary for that device is given by binaries[i] and the length of this corresponding binary is given by lengths[i]. lengths[i] cannot be zero and binaries[i] cannot be a NULL pointer.

  • 二进制文件是指向要为device_list指定的设备加载的程序二进制文件的指针数组。对于device_list[i]给出的每个设备,该设备的程序二进制指针由binaries[i]给出,相应二进制文件的长度由lengths[i]给出。lengths[i]不能为零,binaries[i]不能是NULL指针。

  • binary_status returns whether the program binary for each device specified in device_list was loaded successfully or not. It is an array of num_devices entries and returns CL_SUCCESS in binary_status[i] if binary was successfully loaded for device specified by device_list[i]; otherwise returns CL_INVALID_VALUE if lengths[i] is zero or if binaries[i] is a NULL value or CL_INVALID_BINARY in binary_status[i] if program binary is not a valid binary for the specified device. If binary_status is NULL, it is ignored.

  • ​binary_status返回device_list中指定的每个设备的程序二进制文件是否已成功加载。它是一个num_devices条目的数组,如果成功为device_list[i]指定的设备加载了二进制文件,则返回binary_status[i]中的CL_SUCCESS;否则,如果lengths[i]为零,或者如果binaries[i]为NULL值,则返回CL_INVALID_VALUE;如果程序二进制文件不是指定设备的有效二进制文件,则返回binary_status[i]中的CL_INVALID BINARY。如果binary_status为NULL,则忽略它。

  • errcode_ret will return an appropriate error code. If errcode_ret is NULL, no error code is returned.

  • errcode_ret将返回适当的错误代码。如果errcode_ret为NULL,则不返回错误代码。

The devices associated with the program object will be the list of devices specified by device_list. The list of devices specified by device_list must be devices associated with context.

与程序对象关联的设备将是device_list指定的设备列表。device_list指定的设备列表必须是与context关联的设备。

The program binaries specified by binaries will be loaded into the program object. They contain bits that describe one of the following:

由二进制文件指定的程序二进制文件将被加载到程序对象中。它们包含描述以下内容之一的位:

  • a program executable to be run on the device(s) associated with context,

  • 可在与context相关联的设备上运行的程序,

  • a compiled program for device(s) associated with context, or

  • 与context相关联的设备的编译程序,或

  • a library of compiled programs for device(s) associated with context.

  • 与context相关联的设备的编译程序库。

The program binary can consist of either or both:

程序二进制文件可以由以下任一项或两项组成:

  • Device-specific code and/or,

  • 设备特定代码或,

  • Implementation-specific intermediate representation (IR) which will be converted to the device-specific code.

  • 实现特定的中间表示(IR),它将被转换为设备特定的代码。

OpenCL allows applications to create a program object using the program source or binary and build appropriate program executables. This can be very useful as it allows applications to load program source and then compile and link to generate a program executable online on its first instance for appropriate OpenCL devices in the system. These executables can now be queried and cached by the application. The cached executables can be read and loaded by the application, which can help significantly reduce the application initialization time.

OpenCL允许应用程序使用程序源代码或二进制文件创建程序对象,并构建适当的程序可执行文件。这可能非常有用,因为它允许应用程序加载程序源代码,然后编译和链接以在系统中适当的OpenCL设备的第一个实例上在线生成可执行程序。这些可执行文件现在可以由应用程序查询和缓存。应用程序可以读取和加载缓存的可执行文件,这有助于显著减少应用程序初始化时间。

If the cl_khr_spir extension is supported, clCreateProgramWithBinary can be used to load a SPIR binary. Once a program object has been created from a SPIR binary, clBuildProgram can be called to build a program executable or clCompileProgram can be called to compile the SPIR binary.

​如果支持cl_khr_spir扩展,则可以使用clCreateProgramWithBinary加载SPIR二进制文件。从SPIR二进制文件创建程序对象后,可以调用clBuildProgram来构建程序可执行文件,也可以调用clCompileProgram来编译SPIR二进制程序。

clCreateProgramWithBinary returns a valid non-zero program object and errcode_ret is set to CL_SUCCESS if the program object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in errcode_ret:

clCreateProgramWithBinary返回一个有效的非零程序对象,如果程序对象创建成功,则errcode_ret设置为CL_SUCCESS。否则,它将返回一个NULL值,并在errcode_ret中返回以下错误值之一:

  • CL_INVALID_CONTEXT if context is not a valid context.

  • 如果context 不是有效的上下文,则返回CL_INVALID_CONTEXT。

  • CL_INVALID_VALUE if device_list is NULL or num_devices is zero.

  • 如果device_list为NULL或num_devices为零,则CL_INVALID_VALUE。

  • CL_INVALID_DEVICE if any device in device_list is not in the list of devices associated with context.

  • CL_INVALID_DEVICE,如果device_list中的任何设备不在与context关联的设备列表中。

  • CL_INVALID_VALUE if lengths or binaries is NULL or if any entry in lengths[i] is zero or binaries[i] is NULL.

  • 如果lengths或binaries为NULL,或者lengths[i]中的任何条目为零或binaries[i]为NULL,则CL_INVALID_VALUE。

  • CL_INVALID_BINARY if an invalid program binary was encountered for any device. binary_status will return specific status for each device.

  • CL_INVALID_BINARY,如果任何设备遇到无效的程序二进制文件。binary_status将返回每个设备的特定状态。

  • CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.

  • CL_OUT_OF_RESOURCES,如果无法在设备上分配OpenCL实现所需的资源。

  • CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.

  • CL_OUT_OF_HOST_MEMORY,如果无法在主机上分配OpenCL实现所需的资源。

To create a program object for a context and loads the information related to the built-in kernels into that object, call the function

要为上下文创建程序对象并将与内置内核相关的信息加载到该对象中,请调用以下函数

// Provided by CL_VERSION_1_2
cl_program clCreateProgramWithBuiltInKernels(
    cl_context context,
    cl_uint num_devices,
    const cl_device_id* device_list,
    const char* kernel_names,
    cl_int* errcode_ret);

clCreateProgramWithBuiltInKernels is missing before version 1.2.

clCreateProgramWithBuiltInKernels在1.2版本之前缺失。

  • context must be a valid OpenCL context.

  • context必须是有效的OpenCL上下文。

  • num_devices is the number of devices listed in device_list.

  • num_devices是device_list中列出的设备数量。

  • device_list is a pointer to a list of devices that are in context. device_list must be a non-NULL value. The built-in kernels are loaded for devices specified in this list.

  • device_list是指向context中设备列表的指针。device_list必须是非NULL值。为此列表中指定的设备加载内置内核。

  • kernel_names is a semi-colon separated list of built-in kernel names.

  • kernel_names是一个以分号分隔的内置内核名称列表。

The devices associated with the program object will be the list of devices specified by device_list. The list of devices specified by device_list must be devices associated with context.

与程序对象关联的设备将是device_list指定的设备列表。device_list指定的设备列表必须是与上下文关联的设备。

clCreateProgramWithBuiltInKernels returns a valid non-zero program object and errcode_ret is set to CL_SUCCESS if the program object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in errcode_ret:

clCreateProgramWithBuiltInKernels返回一个有效的非零程序对象,如果程序对象创建成功,则errcode_ret设置为CL_SUCCESS。否则,它将返回一个NULL值,并在errcode_ret中返回以下错误值之一:

  • CL_INVALID_CONTEXT if context is not a valid context.

  • 如果context不是有效的上下文,则返回CL_INVALID_CONTEXT。

  • CL_INVALID_VALUE if device_list is NULL or num_devices is zero.

  • 如果device_list为NULL或num_devices为零,则CL_INVALID_VALUE。

  • CL_INVALID_VALUE if kernel_names is NULL or kernel_names contains a kernel name that is not supported by any of the devices in device_list.

  • 如果kernel_names为NULL,或者kernel_names包含device_list中任何设备都不支持的内核名称,则返回CL_INVALID_VALUE。

  • CL_INVALID_DEVICE if any device in device_list is not in the list of devices associated with context.

  • CL_INVALID_DEVICE,如果device_list中的任何设备不在与context关联的设备列表中。

  • CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.

  • CL_OUT_OF_RESOURCES,如果无法在设备上分配OpenCL实现所需的资源。

  • CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.

  • CL_OUT_OF_HOST_MEMORY,如果无法在主机上分配OpenCL实现所需的资源。

如何混用ViennaCL与OpenCL ViennaCL是架构于OpenCL,CUDA, OpenMP上层的开源的线性代数求解器库,相当于GPU上运行的Ublas,本文是ViennaCL用户手册译文,重点梳理了ViennaCL如何重用项目中用户自定义的Context,如何添加用户自定义的kernel等OpenCL与ViennaCL合用的问题。 立即下载

相关推荐

2026软件测试面试题全解析:从用例设计到接口自动化与性能实战

在软件测试岗位的招聘考察中,面试官越来越看重候选人解决实际问题的工程能力,而不仅仅是背诵概念。从最基础的测试用例设计出发,覆盖功能测试、接口测试、自动化测试、性能测试、数据库与Redis一致性等核心知识体系,是应对中高级岗位面试的关键路径。理解Postman抓包、Python脚本、Pytest框架、JMeter压测指标背后的原理,能帮助测试人员构建完整的质量保障思维。当AI辅助测试成为行业新趋势时,掌握数据校验链路与风险识别意识,更能体现资深测试工程师的竞争力。本文围绕2026年高频软件测试面试题,梳理了从

weixin_28676289的博客 251

OpenCL编程步骤(三):创建和编译程序

OpenCL程序是由一组内核组成,而这些内核就是程序源码中以限定符__kernel声明的函数。__kernel函数可能会用到一些辅助函数以及常量数据,他们也是程序的一部分。 1、创建程序对象 cl_program clCreateProgramWithSource(cl_context context, cl_uint

Ven_J的博客 6662

ADP在线自适应动态规划之持续激励条件

在线自适应动态规划之持续激励条件 在在线自适应动态规划算法中,需要通过满足持续激励条件(Persistent Excitation Condition)保证critic网络权值的收敛性,一般的做法都是在算法初期在输入端引入探测噪声(Probing Noises)来保证数据的丰富性,但是由于在输入端引入噪声会给系统带来一些不好的影响,甚至可能破坏系统的稳定性。因此,出现了一些其他的方法来避免引入探测噪声,受阅读所限,我目前了解两种: Concurrent Learning(CL) Experience Re

qq_43435956的博客 6163

Windows Opencl clCreateProgramWithSource()函数

Windows Opencl clCreateProgramWithSource()函数详细解析 函数原型 cl_program clCreateProgramWithSource (cl_context context, cl_uint count, const char **strings, const size_t *l

qq_42877866的博客 1996

锐捷路由器DNS Proxy保姆级配置教程:从零到实战,手把手教你搞定内网域名解析

本文提供锐捷路由器DNS Proxy功能的详细配置教程,从基础环境搭建到实战测试,手把手教你实现内网域名解析。涵盖上游DNS设置、内网域名映射、故障排查等关键步骤,帮助网络管理员快速解决内网访问难题,提升工作效率。

weixin_29284657的博客 565

BUCK电路三种工作模式全解析:CCM、BCM、DCM到底怎么选?

本文深入解析BUCK电路的CCM、DCM和BCM三种工作模式,通过对比其电流波形、效率、纹波及环路特性,提供基于计算公式的量化判断方法。文章结合电池供电、高精度模拟等具体应用场景,给出明确的模式选型策略与实战设计指南,帮助工程师根据核心需求做出最优决策。

ee345的博客 503

clCreateProgramWithBinary 和 clCreateProgramWithSource

摘录: 使用clCreateProgramWithSource()创建完的是一个包含源代码的程序对象;要运行设备上的OpenCL程序必须对它进行编译、连接;而对于用clCreateProgramWithBinary创建的程序对象,则只需要进行连接。最后构建成一个完整的可加载的执行程序。我们通过clBuildProgram这个函数来构建OpenCL程序。 (即,到buildProgram这一步,

thefighteran的专栏 5016

微机原理与接口技术第六版周荷琴课后习题答案及解析(期末重点)

第二章 1.8086/8088CPU可直接寻址多少个内存(字节)单元?多少个I/O端口?它们的外部数据总线各有多少根? 8086/8088CPU使用的是20位地址总线,因此可以直接寻址2的20次方个内存单元(即1,048,576),每个单元大小为1字节,因此可以直接寻址2的20次方个字节的内存。 8086/8088CPU有64K个I/O端口,每个端口占用1字节的地址空间,因此可以直接寻址6...

Wmicheng的博客 1万+

OpenCL——上下文和程序对象

创建上下文和命令队列 创建OpenCL上下文 上下文为关联的设备、内存对象、命令对象、程序对象、内核对象提供了一个容器。上下文是OpenCL应用的核心。正是上下文驱动着应用程序与特定设备以及特定设备之间的通信。 对于上下文中关联的所有计算设备必须全都来自于同一平台,对于来自不同平台的OpenCL设备,需要为各个平台独立地建立上下文。对于同一平台的设备,上下文中可以关联多个设备。主机应用也可以使用多...

绝尘 1430

一文入门Qwen-Agent【附实战代码】

Qwen-Agent 是一个开源框架,用于开发基于 Qwen 模型的 AI 智能体应用,一文带你入门使用

m0_55303420的博客 1886

无需SLAM建图,直接生成Gazebo仿真环境的二维代价地图的功能包pgm_map_creator适配ROS Noetic编译报错及解决方法

在ROS Noetic中,使用`pgm_map_creator`功能包直接生成Gazebo仿真环境的二维代价地图时,可能会遇到各种编译和运行错误。本篇博客详细解析了在适配ROS Noetic过程中常见的报错及其解决方法,包括Boost文件结构更新、C++版本兼容性、Gazebo函数名变更、链接库缺失以及protobuf文件加载错误。通过逐步排查和修改,如更换头文件路径、调整C++标准、更新CMakeLists.txt文件等,成功解决了这些问题,使得`pgm_map_creator`功能包能够顺利编译和运行。

慕羽★的博客 2265

OpenCL™规范官方指南文档目录

OpenCL™规范-CSDN博客

aggs1990的专栏 1669

Spring AI Alibaba 1.x 源码分析-架构设计

本文通过分析Spring AI Alibaba 框架的源码,分析出其原理和架构设计,无论是用于项目开发、技术评估还是团队培训都具有重要价值。

program哲学 490

OpenCL™规范 5.3.1. 创建图像对象

CL_MEM_USE_HOST_TR、CL_MEM_ALLOC_HOST_PTR和CL_MEM_COPY_HOST_PTR值不能在标志中指定,而是从与mem_object相关联的相应内存访问限定符继承而来。CL_INVALID_HOST_PTR,如果在标志中设置了HOST_PTR为NULL且CL_MEM_USE_HOST_PTR或CL_MEM_COPY_HOST_PTR,或者如果HOST_PTR不为NULL但在标志中未设置CL_MEM_COPY_HOST_PTR或CL_MEM_USE_HOST_PTR。

aggs1990的专栏 566

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

OpenCL™规范 附录E:OpenCL的更改

:OpenCL 1.1平台层和运行时中添加了以下功能(第4节和第5节):table 4.3对表4.3的以下查询CL_CONTEXT_NUM_DEVICES返回到指定给clGetContextInfo的查询列表。CL_RxCL_RGx, andCL_RGBx​可选图像格式:CL_Rx、CL_RGx和CL_RGBx。​支持子缓冲区对象使用clCreateSubBuffer创建引用另一个缓冲区对象中特定区域的缓冲区对象的能力。and。

aggs1990的专栏 405

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

OpenCL™规范 5.9.1. 创建内核对象

clCreateKernel返回一个有效的非零内核对象,如果内核对象创建成功,则errcode_ret设置为CL_SUCCESS。CL_OUT_OF_HOST_MEMORY,如果无法在主机上分配OpenCL实现所需的资源。CL_OUT_OF_HOST_MEMORY,如果无法在主机上分配OpenCL实现所需的资源。CL_OUT_OF_HOST_MEMORY,如果无法在主机上分配OpenCL实现所需的资源。CL_OUT_OF_HOST_MEMORY,如果无法在主机上分配OpenCL实现所需的资源。

aggs1990的专栏 243

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

OpenCL™规范 5.1. 命令队列

​如果command_queue是使用clCreateCommandQueue创建的,或者如果clCreateCommandQueueWithProperties中指定的属性参数为NULL,则该实现必须返回等于0的param_value_size_ret,这表示没有要返回的属性。如果用于创建command_queue的clCreateCommandQueueWithProperties中指定的属性参数不为NULL,则实现必须以相同的顺序返回属性参数中指定的值,并且不包括其他属性。否则,将有序执行命令。

aggs1990的专栏 686

OpenCL™规范 5.11.1. 创建、等待和释放事件对象

​当与事件关联的命令的执行状态更改为等于或超过command_exec_status指定的状态时,或者如果命令异常终止,则更改为CL_COMPLETE指定的执行状态时,将调用已注册的回调函数。如果pfn_event_notify为NULL,或者command_exec_callback_type不是CL_SUBMITED、CL_RUNNING或CL_COMPLETE,则为CL_INVALID_VALUE。param_value_size_ret返回param_name查询的数据的实际大小(以字节为单位)。

aggs1990的专栏 338

OpenCL™规范 5.2.1. 创建缓冲区对象

返回的新缓冲区对象具有作为底层存储的共享内存。CL_INVALID_VALUE如果缓冲区是用CL_MEM_WRITE_ONLY创建的,并且标志指定CL_MEM_READ_WRITE或CL_MEM_READ_ONLY,或者如果缓冲区用CL_MEM_READ_ONLY创建的并且标志指定了CL_MEM_READ_WRITE或CL_MEM_WRITE_ONLY,或如果标志指定了CL _MEM_USE_HOST_PTR或CL _MEM_ALLOC_HOST_PTR或CL_MEM _COPY_HOST_PSTR。

aggs1990的专栏 573

OpenCL™规范 5.8.9. 程序对象查询

为CL_PROGRAM_NUM_KERNELS、CL_PROGRAM-KERNEL_NAMES、CL_PROGRAM_SCOPE_GLOBAL_CTORS_PRESENT或CL_PROGRAD_SCOPE_GOLBAL_DTORS_PRESENCE,并且尚未为与程序关联的设备列表中的至少一个设备构建成功的程序可执行文件,则为CL_INVALID_PRORAM_EXECUTABLE。param_value_size_ret返回param_name查询的数据的实际大小(以字节为单位)。

aggs1990的专栏 157

OpenCL™规范 5.8.6.5. 控制OpenCL C版本的选项

应用程序需要指定-cl-std=CL2.0构建选项以使用OpenCL C 2.0编译或构建程序,并指定-cl-std=CL3.0构建选项以用OpenCL C 3.0编译或生成程序。​使用-cl std=CL2.0选项调用clBuildProgram或clCompileProgram将无法为CLD_OPENCL_C_VERSION等于OPENCL C 1.2或更低版本的任何设备编译程序,并且CLD_OPENCL_CALL_VERSION不包括OPENCL C 2.0。确定要使用的OpenCL C语言版本。

aggs1990的专栏 334

OpenCL™规范 5.8. 程序对象

OpenCL程序由一组内核组成,这些内核被标识为程序源代码中用__kernel限定符声明的函数。OpenCL程序还可能包含辅助函数和内核函数可以使用的常量数据。可执行程序可以由OpenCL编译器为相应的目标设备在线或离线生成。最新成功构建的程序可执行文件、库或编译二进制文件,构建程序可执行程序、库或汇编二进制文件的设备列表,使用的构建选项和构建日志。当前附加的内核对象的数量。程序源代码或二进制文件。

aggs1990的专栏 132

OpenCL™规范 5.7.1. 创建采样器对象

​如果支持cl_khr_mipmap_image扩展,则无法使用OpenCL程序源中初始化的任何采样器指定采样器属性CL_SAMPLER_MIP_FILTER_MODE_KHR、CL_SAMPLER_LOD_MIN_KHR和CL_SAMPLER_LOD_MAX_KHR。​sampler_properties指定采样器属性名称及其相应值的列表。CL_INVALID_VALUE如果sampler_properties中的属性名称不是支持的属性名称,如果为支持的属性名指定的值无效,或者如果多次指定相同的属性名。

aggs1990的专栏 194

OpenCL™规范 5.8.8. 卸载OpenCL编译器

这是应用程序的提示,并不保证编译器将来不会被使用,也不保证编译器实际上会被实现卸载。如有必要,在clUnloadPlatformCompiler之后调用clBuildProgram、clCompileProgram或clLinkProgram将重新加载编译器,以构建相应的可执行程序。这是应用程序的提示,并不保证编译器将来不会被使用,也不保证编译器实际上会被实现卸载。或者,如果没有通过ICD加载器使用OpenCL,则可以使用以下函数卸载OpenCL编译器。要卸载平台的OpenCL编译器,请调用以下函数。

aggs1990的专栏 958

OpenCL™规范 5.8.2. 保留和释放程序对象

关联的回调堆栈上注册指定的回调函数。CL_OUT_OF_HOST_MEMORY,如果无法在主机上分配OpenCL实现所需的资源。CL_OUT_OF_HOST_MEMORY,如果无法在主机上分配OpenCL实现所需的资源。CL_OUT_OF_HOST_MEMORY,如果无法在主机上分配OpenCL实现所需的资源。CL_OUT_OF_RESOURCES,如果无法在设备上分配OpenCL实现所需的资源。CL_OUT_OF_RESOURCES,如果无法在设备上分配OpenCL实现所需的资源。

aggs1990的专栏 218

OpenCL™规范 5.2.7. 从OpenGL缓冲区对象创建OpenCL缓冲区对象

如果通过OpenGL API(例如glBufferData)修改OpenGL缓冲区对象的状态,同时存在相应的OpenCL缓冲区对象,则后续使用OpenCL缓冲区时将导致未定义的行为。只能使用该表中指定的CL_MEM_READ_ONLY、CL_MEM_WRITE_ONLY和CL_MEM_READ_WRITE标志。bufobj是OpenGL缓冲区对象的名称。CL_INVALID_GL_OBJECT如果bufobj不是OpenGL缓冲区对象,或者是OpenGL缓冲区,但没有现有的数据存储,或者缓冲区的大小为0。

aggs1990的专栏 218
上一篇: 实例渲染(Instanced Rendering)
下一篇: Qt Creator 14-CMake更新
꧁白杨树下꧂
博客等级 码龄15年 1019粉丝 209原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值