forked from QianMo/GPU-Gems-Book-Source-Code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.txt
73 lines (54 loc) · 2.3 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
GPU-Based Option Pricing Demo
-----------------------------
This command-line application demonstrates how two different option
pricing models -- Black-Scholes and binomial lattice -- can be
implemented on the GPU.
Requirements
------------
To run the demo, you will need:
- PC running windows 2000/XP
- GPU capable of running moderately complex fragment programs
To recompile the demo, you will need:
- Cg Toolkit version 1.2 or later (see developer.nvidia.com)
Running
-------
The application generates random input data (strike price, time
to expiration, volatility, etc.) for each of the specified number of
options, and then prices the options using the specified method.
By default, the options are priced using both the CPU and GPU,
with timing results and difference statistics printed to the console.
You must run the application from the top-directory containing
the various .cg source files.
usage: options [arguments]
Where arguments consists of:
-put Price puts.
-call Price calls.
-n nopts Price nopts options.
-sn nopts Price nopts^2 options.
-a Assume American-style exercise.
-e Assume European-style exercise.
-bs Price using Black-Scholes.
-bin nsteps Price using binomial lattice model with nsteps steps.
-t ntests Price each set of option ntests times.
-cpu Don't run CPU-based pricing.
-gpu Don't run GPU-based pricing.
-rb Don't read back results from GPU.
-seed seed Set random number seed.
-h Print help.
Examples
--------
2048 American put options priced using binomial lattice model with 512 steps,
repeated 10 times:
% options -a -put -bin 512 -n 2048 -t 10
Initialization: 0.214s
2048 American put options, Binomial (512 steps)
CPU Elapsed time for 10 runs: 26.151 (0.783 K/sec)
GPU Elapsed time for 10 runs: 4.567 (4.485 K/sec)
RMS diff: 6.75417e-005, Max diff: 0.035%, GPU Avg: 7.45583, CPU Avg: 7.45588
1024*1024 European call options priced using Black-Scholes, repeated 20 times:
% options -e -call -bs -sn 1024 -t 20
Initialization: 0.328s
1048576 European call options, Black-Scholes
CPU Elapsed time for 20 runs: 7.208 (2909.319 K/sec)
GPU Elapsed time for 20 runs: 1.160 (18074.157 K/sec)
RMS diff: 1.494e-006, Max diff: 0.027%, GPU Avg: 3.909, CPU Avg: 3.909