black_scholes test won't work.
- Dominant language
- C++
- Stars
- 1.7k
- Forks
- 340
- PR merge metrics
- No merged PRs in 30d
Description
Was running the test set and found out that black_scholes doesn't work on my laptop.
``` bash
> ./black_scholes
device: HD Graphics 4000
libc++abi.dylib: terminating with uncaught exception of type boost::exception_detail::clone_impl >: OpenCL Build Warning : Compiler build log:
:1:7: warning: no previous prototype for function 'cnd'
float cnd(float d) [...]
```
Seams like the compiler on OSX need predeclaration to work, with predeclaration this seems to work:
``` bash
diff --git a/example/black_scholes.cpp b/example/black_scholes.cpp
index e78e895..952d28d 100644
--- a/example/black_scholes.cpp
+++ b/example/black_scholes.cpp
@@ -69,6 +69,10 @@ int main()
// source code for black-scholes program
const char source[] = BOOST_COMPUTE_STRINGIZE_SOURCE(
+
+ // some compiler need predeclaration
+ float cnd(float d);
+
// approximation of the cumulative normal distribution function
float cnd(float d)
{
```
Maybe you should not crash on warnings?
Nice work!
##
Contributor guide
Assessment
This issue has not been assessed yet.