GPU Workshop Sample Code
 All Data Structures Namespaces Files Functions Variables Macros Pages
Functions | Variables
get_option_payoffs.cu File Reference

Option pricing code for model proposed by Christoffersen et al (2012, JFE) More...

#include "rng.c"

Go to the source code of this file.

Functions

__device__ double get_payoff (double S, double K, int option_type)
 Compute payoff of option. More...
 
__device__ double normal_pdf (double x, double mu, double sd)
 
__global__ void get_option_payoffs (double *payoff_d, double *state_d, unsigned int *seed_d, const double *parms, const double *strike, const int *option_type, int noption, double T, int nsim)
 

Variables

const int CALL = 0
 
const int PUT = 1
 
const int JMAX = 10
 
const double SQRT2PI = 2.506628274631
 

Detailed Description

Option pricing code for model proposed by Christoffersen et al (2012, JFE)

Definition in file get_option_payoffs.cu.

Function Documentation

__global__ void get_option_payoffs ( double *  payoff_d,
double *  state_d,
unsigned int *  seed_d,
const double *  parms,
const double *  strike,
const int *  option_type,
int  noption,
double  T,
int  nsim 
)

payoff_d, (out) simulated payoffs state_d, (in/out) Latent states (volatility and jump intensity) seed_d, (in/out) RNG seeds parms, (in) Model parameters strike, (in) Strike prices option_type, (in) 0=call, 1=put noption, (in) Number of options to be priced T, (in) Time to maturity nsim (in) Number of simulated paths to use

Definition at line 53 of file get_option_payoffs.cu.

__device__ double get_payoff ( double  S,
double  K,
int  option_type 
)

Compute payoff of option.

Parameters
S(in) stock price
K(in) strike price
option_type(in) Option types (0=call, 1=put)

Definition at line 14 of file get_option_payoffs.cu.

__device__ double normal_pdf ( double  x,
double  mu,
double  sd 
)

Definition at line 30 of file get_option_payoffs.cu.

Variable Documentation

const int CALL = 0

Definition at line 6 of file get_option_payoffs.cu.

const int JMAX = 10

Definition at line 8 of file get_option_payoffs.cu.

const int PUT = 1

Definition at line 7 of file get_option_payoffs.cu.

const double SQRT2PI = 2.506628274631

Definition at line 9 of file get_option_payoffs.cu.