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

5.8.8. Unloading the OpenCL Compiler
5.8.8. 卸载OpenCL编译器

To unload an OpenCL compiler for a platform, call the function

要卸载平台的OpenCL编译器,请调用以下函数

// Provided by CL_VERSION_1_2
cl_int clUnloadPlatformCompiler(
    cl_platform_id platform);

clUnloadPlatformCompiler is missing before version 1.2.

clUnloadPlatformCompiler在1.2版本之前缺失。

  • platform is the platform to unload.

  • platform是卸载的平台。

This function allows the implementation to release the resources allocated by the OpenCL compiler for platform. This is a hint from the application and does not guarantee that the compiler will not be used in the future or that the compiler will actually be unloaded by the implementation. Calls to clBuildProgramclCompileProgram or clLinkProgram after clUnloadPlatformCompiler will reload the compiler, if necessary, to build the appropriate program executable.

​此函数允许实现释放OpenCL编译器为平台分配的资源。这是应用程序的提示,并不保证编译器将来不会被使用,也不保证编译器实际上会被实现卸载。如有必要,在clUnloadPlatformCompiler之后调用clBuildProgram、clCompileProgram或clLinkProgram将重新加载编译器,以构建相应的可执行程序。

clUnloadPlatformCompiler returns CL_SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:

如果函数执行成功,clUnloadPlatformCompiler将返回CL_SUCCESS。否则,它将返回以下错误之一:

  • CL_INVALID_PLATFORM if platform is not a valid platform.

  • CL_INVALID_PLATFORM(如果platform不是有效平台)。

Alternatively, if you are not using OpenCL via the ICD loader, you may unload the OpenCL compiler with the function

或者,如果没有通过ICD加载器使用OpenCL,则可以使用以下函数卸载OpenCL编译器

// Provided by CL_VERSION_1_0
cl_int clUnloadCompiler(void);

clUnloadCompiler is deprecated by version 1.2.

clUnloadCompiler 1.2版本已弃用。

This function allows the implementation to release the resources allocated by the OpenCL compiler. This is a hint from the application and does not guarantee that the compiler will not be used in the future or that the compiler will actually be unloaded by the implementation. Calls to clBuildProgramclCompileProgram or clLinkProgram after clUnloadCompiler will reload the compiler, if necessary, to build the appropriate program executable.

​此函数允许实现释放OpenCL编译器分配的资源。这是应用程序的提示,并不保证编译器将来不会被使用,也不保证编译器实际上会被实现卸载。如有必要,在clUnloadCompiler之后调用clBuildProgram、clCompileProgram或clLinkProgram将重新加载编译器,以构建相应的可执行程序。

clUnloadCompiler will always return CL_SUCCESS.

clUnloadCompiler将始终返回CL_SUCCESS。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值