Skip to content

Commit 5d88d3c

Browse files
wsmosesmaleadt
andauthored
Group PTX fast-math optimization passes under :fastmath (#828)
Co-authored-by: Tim Besard <tim.besard@gmail.com>
1 parent f42d1cf commit 5d88d3c

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/ptx.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,11 @@ function optimize_module!(@nospecialize(job::CompilerJob{PTXCompilerTarget}),
291291
register!(pb, NVVMReflectPass())
292292
add!(pb, NVVMReflectPass())
293293
end
294-
add!(pb, PTXRSqrtFastPass())
295-
add!(pb, PTXFDivFastPass())
296-
add!(pb, PTXFSqrtFastPass())
294+
if get(optimization_options(job), :fastmath, true)
295+
add!(pb, PTXRSqrtFastPass())
296+
add!(pb, PTXFDivFastPass())
297+
add!(pb, PTXFSqrtFastPass())
298+
end
297299

298300
add!(pb, NewPMFunctionPassManager()) do fpm
299301
# needed by GemmKernels.jl-like code

0 commit comments

Comments
 (0)