This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

调用cl_arm_import_memory报错CL_INVALID_PROPERTY

Hello:

 

调用cl_arm_import_memory报错,错误号CL_INVALID_PROPERTY。

我尝试的调用方法如下:

 

方式一:

cl_int clRet = 0;

image->pImageData = malloc(image->iImageSize);

image->handler = clImportMemoryARM(oclContext(), CL_MEM_READ_WRITE, NULL, image->pImageData, image->iImageSize, &clRet);

 

方式二:

cl_int clRet = 0;

cl_import_properties_arm importProps[] = {CL_IMPORT_TYPE_ARM, CL_IMPORT_TYPE_HOST_ARM, 0};

image->pImageData = malloc(image->iImageSize);

image->handler = clImportMemoryARM(oclContext(), CL_MEM_READ_WRITE, importProps, image->pImageData, image->iImageSize, &clRet);

 

两种方式均报出前述错误。

 

注意到该API的文档中提到:

      If the extension string cl_arm_import_memory_dma_buf is exposed then

      importing from DMA_BUF file handles is supported.

      If the extension string cl_arm_import_memory_host is exposed then importing

      from normal process allocations (such as malloc) is supported.

 

但是我们的设备并没有上述扩展字符串,只有cl_arm_import_memory一个。

我们设备的详细信息见下,请帮忙确认一下我们的设备是否支持clImportMemoryARM,谢谢。

OpenCL-Z-Android Report
========================
Version: 1.0.1
Release date: April 2015
Author: Robert Wang
Email: robertwgh@gmail.com
Website: http://web.guohuiwang.com

Phone/Tablet Information
--------------------------------
Device model: NICIGO
Android OS version: 6.0
Kernel version: 3.18.22, 周六 10月 29 15:55:55 2016
Build number: MRA58K release-keys
CPU ABI: arm64-v8a
CPU ABI 2: armeabi-v7a

OpenCL Information
-------------------------
Found 1 OpenCL platforms.
[Platform] INDEX: 1
[Platform] NAME: ARM Platform
[Platform] VENDOR: ARM
[Platform] PROFILE: FULL_PROFILE
[Platform] VERSION: OpenCL 1.1 v1.r7p0-02rel0.a6c0939b3050616905647b55b149c24b
[Platform] EXTENSIONS: cl_khr_global_int32_base_atomics;cl_khr_global_int32_extended_atomics;cl_khr_local_int32_base_atomics;cl_khr_local_int32_extended_atomics;cl_khr_byte_addressable_store;cl_khr_3d_image_writes;cl_khr_fp64;cl_khr_int64_base_atomics;cl_khr_int64_extended_atomics;cl_khr_fp16;cl_khr_gl_sharing;cl_khr_icd;cl_khr_egl_event;cl_khr_egl_image;cl_arm_core_id;cl_arm_printf;cl_arm_thread_limit_hint;cl_arm_non_uniform_work_group_size;cl_arm_import_memory


Found 1 devices:
[Device] INDEX: 1
[Device] TYPE: GPU
[Device] NAME: Mali-T860
[Device] VENDOR: ARM
[Device] VENDOR_ID: 0x8600020>>>
[Device] DRIVER_VERSION: 1.1
[Device] PROFILE: FULL_PROFILE
[Device] VERSION: OpenCL 1.1 v1.r7p0-02rel0.a6c0939b3050616905647b55b149c24b
[Device] MAX_CLOCK_FREQUENCY: 5 MHz
[Device] MAX_COMPUTE_UNITS: 2
[Device] AVAILABLE: true
[Device] COMPILER_AVAILABLE: true
[Device] EXTENSIONS: cl_khr_global_int32_base_atomics;cl_khr_global_int32_extended_atomics;cl_khr_local_int32_base_atomics;cl_khr_local_int32_extended_atomics;cl_khr_byte_addressable_store;cl_khr_3d_image_writes;cl_khr_fp64;cl_khr_int64_base_atomics;cl_khr_int64_extended_atomics;cl_khr_fp16;cl_khr_gl_sharing;cl_khr_icd;cl_khr_egl_event;cl_khr_egl_image;cl_arm_core_id;cl_arm_printf;cl_arm_thread_limit_hint;cl_arm_non_uniform_work_group_size;cl_arm_import_memory
[Device] MAX_WORK_ITEM_DIMENSIONS: 3
[Device] MAX_WORK_ITEM_SIZES: (256, 256, 256)
[Device] MAX_WORK_GROUP_SIZE: 256
[Device] ADDRESS_BITS: 64
[Device] MAX_READ_IMAGE_ARGS: 128
[Device] MAX_WRITE_IMAGE_ARGS: 8
[Device] MAX_MEM_ALLOC_SIZE: 536870912
[Device] IMAGE2D_MAX_WIDTH: 65536
[Device] IMAGE2D_MAX_HEIGHT: 65536
[Device] IMAGE3D_MAX_WIDTH: 65536
[Device] IMAGE3D_MAX_HEIGHT: 65536
[Device] IMAGE3D_MAX_DEPTH: 65536
[Device] IMAGE_SUPPORT: true
[Device] MAX_PARAMETER_SIZE: 1024
[Device] MAX_SAMPLERS: 16
[Device] MEM_BASE_ADDR_ALIGN: 1024
[Device] MIN_DATA_TYPE_ALIGN_SIZE: 128
[Device] SINGLE_FP_CONFIG: CL_FP_DENORM;CL_FP_INF_NAN;CL_FP_ROUND_TO_NEAREST;CL_FP_ROUND_TO_ZERO;CL_FP_ROUND_TO_INF;CL_FP_FMA;
[Device] HOST_UNIFIED_MEMORY: Unified
[Device] GLOBAL_MEM_CACHE_TYPE: read/write cache
[Device] GLOBAL_MEM_CACHELINE_SIZE: 64
[Device] GLOBAL_MEM_CACHE_SIZE: 262144
[Device] GLOBAL_MEM_SIZE: 2147483648
[Device] MAX_CONSTANT_BUFFER_SIZE: 65536
[Device] MAX_CONSTANT_ARGS: 8
[Device] LOCAL_MEM_TYPE: global
[Device] LOCAL_MEM_SIZE: 32768
[Device] ERROR_CORRECTION_SUPPORT: false
[Device] PROFILING_TIMER_RESOLUTION: 1000 nanoseconds
[Device] ENDIAN_LITTLE: true
[Device] EXECUTION_CAPABILITIES: CL_EXEC_KERNEL;
[Device] QUEUE_PROPERTIES: CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE;CL_QUEUE_PROFILING_ENABLE;
[Device] PREFERRED_VECTOR_WIDTH_CHAR: 16
[Device] PREFERRED_VECTOR_WIDTH_SHORT: 8
[Device] PREFERRED_VECTOR_WIDTH_INT: 4
[Device] PREFERRED_VECTOR_WIDTH_LONG: 2
[Device] PREFERRED_VECTOR_WIDTH_FLOAT: 4
[Device] PREFERRED_VECTOR_WIDTH_DOUBLE: 2
[Device] PREFERRED_VECTOR_WIDTH_HALF: 8
[Device] NATIVE_VECTOR_WIDTH_CHAR: 16
[Device] NATIVE_VECTOR_WIDTH_SHORT: 8
[Device] NATIVE_VECTOR_WIDTH_INT: 4
[Device] NATIVE_VECTOR_WIDTH_LONG: 2
[Device] NATIVE_VECTOR_WIDTH_FLOAT: 4
[Device] NATIVE_VECTOR_WIDTH_DOUBLE: 2
[Device] NATIVE_VECTOR_WIDTH_HALF: 8