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

Commit 42bd161

Browse files
author
Paul H. Liu
committed
Fix bug with @Noacc
1 parent a97f53d commit 42bd161

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/OptFramework.jl

+7-4
Original file line numberDiff line numberDiff line change
@@ -590,15 +590,19 @@ function findOriginalFunc(mod::Module, name::Symbol)
590590
end
591591

592592
function recursive_noacc(ast::Symbol)
593-
findoriginalfunc(current_module(), ast)
593+
if haskey(gOptFrameworkDict, GlobalRef(current_module(), ast))
594+
findOriginalFunc(current_module(), ast)
595+
else
596+
ast
597+
end
594598
end
595599

596600
function recursive_noacc(ast::Expr)
597601
start = 1
598602
if is(ast.head, :(=))
599603
start = 2
600-
elseif is(ast.head, :call) && isa(ast.args[1], Symbol)
601-
ast.args[1] = findOriginalFunc(current_module(), ast.args[1])
604+
elseif is(ast.head, :call) && isa(ast.args[1], Symbol)
605+
ast.args[1] = recursive_noacc(ast.args[1])
602606
start = 2
603607
end
604608
for i = start:length(ast.args)
@@ -616,7 +620,6 @@ The macro @noacc can be used at call site to specifically run the non-accelerate
616620
"""
617621
macro noacc(ast)
618622
ast = recursive_noacc(ast)
619-
println(ast)
620623
esc(ast)
621624
end
622625

0 commit comments

Comments
 (0)