Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

OptFramework failed to optimize function when using function wrapper #156

@NaelsonDouglas

Description

@NaelsonDouglas

Hello.

I'm trying to execute the below, but I'm getting the following message
julia> include("simple_ips.jl")
OptFramework failed to optimize function ##process#658 in optimization pass ParallelAccelerator.Driver.toDomainIR with error AssertionError("")

It's basically a wrapper on the gaussian-blur example.

What am I doing wrong since ParallelAccelerator is not able to optimize the function?

using Images
using ImageView
using ImageMagick
using TestImages
using FileIO
using ParallelAccelerator
using DocOpt
using Images


end

function blur(img, iterations)
    buf = copy(img)
    runStencil(buf, img, iterations, :oob_src_zero) do b, a
       b[0,0] =
      (a[-2,-2] * 0.003  + a[-1,-2] * 0.0133 + a[0,-2] * 0.0219 + a[1,-2] * 0.0133 + a[2,-2] * 0.0030 +
       a[-2,-1] * 0.0133 + a[-1,-1] * 0.0596 + a[0,-1] * 0.0983 + a[1,-1] * 0.0596 + a[2,-1] * 0.0133 +
       a[-2, 0] * 0.0219 + a[-1, 0] * 0.0983 + a[0, 0] * 0.1621 + a[1, 0] * 0.0983 + a[2, 0] * 0.0219 +
       a[-2, 1] * 0.0133 + a[-1, 1] * 0.0596 + a[0, 1] * 0.0983 + a[1, 1] * 0.0596 + a[2, 1] * 0.0133 +
       a[-2, 2] * 0.003  + a[-1, 2] * 0.0133 + a[0, 2] * 0.0219 + a[1, 2] * 0.0133 + a[2, 2] * 0.0030)
    return a, b
    end
    return img
end
    
##session_id doesnt do anything in the code yet
@acc function process(session_id,kernel,input, iterations)
	img = load(input)
	img2 = kernel(img,iterations)
	save("portinari-blur.png",img2)


process(1,blur,"portinari.png")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions