*读取图像
read_image (Image, 'printer_chip/printer_chip_01')
count_seconds (Seconds)
lines_gauss (Image, Lines, 1.5, 3, 8, 'light', 'true', 'bar-shaped', 'true')
count_seconds (Seconds1)
timeCpu:=Seconds1-Seconds
query_available_compute_devices (DeviceIdentifier)
if (|DeviceIdentifier|>0)
get_compute_device_info (DeviceIdentifier[0], 'name', DeviceName)
get_compute_device_info (DeviceIdentifier[0], 'vendor', DeviceVendor)
open_compute_device (DeviceIdentifier[0], DeviceHandle)
set_compute_device_param (DeviceHandle, 'asynchronous_execution', 'false')
*初始化
init_compute_device (DeviceHandle, 'lines_gauss')
*激活
activate_compute_device (DeviceHandle)
endif
*调用
count_seconds (Seconds2)
lines_gauss (Image, Lines, 1.5, 3, 8, 'light', 'true', 'bar-shaped', 'true')
count_seconds (Seconds3)
timeGpu:=Seconds3-Seconds2
*对比
timeCompare1:=timeCpu/timeGpu
timeCompare2:=timeCpu-timeGpu
测试gpu算子加速对比
最新推荐文章于 2024-09-17 20:00:16 发布