From a3df993ca890c0769255019b84ff7a0bf52dffc3 Mon Sep 17 00:00:00 2001 From: kchristin Date: Sun, 17 Nov 2024 14:51:19 +0200 Subject: [PATCH] Add launch_bounds attr to kernel --- demos/CUDA/BlackScholes/BlackScholes_kernel.cuh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/demos/CUDA/BlackScholes/BlackScholes_kernel.cuh b/demos/CUDA/BlackScholes/BlackScholes_kernel.cuh index bba537301..1db634b4c 100644 --- a/demos/CUDA/BlackScholes/BlackScholes_kernel.cuh +++ b/demos/CUDA/BlackScholes/BlackScholes_kernel.cuh @@ -82,12 +82,13 @@ __device__ inline void BlackScholesBodyGPU(float& CallResult, float& PutResult, //////////////////////////////////////////////////////////////////////////////// // Process an array of optN options on GPU //////////////////////////////////////////////////////////////////////////////// -__global__ void BlackScholesGPU(float2* __restrict d_CallResult, - float2* __restrict d_PutResult, - float2* __restrict d_StockPrice, - float2* __restrict d_OptionStrike, - float2* __restrict d_OptionYears, - float Riskfree, float Volatility, int optN) { +__launch_bounds__(128) __global__ + void BlackScholesGPU(float2* __restrict d_CallResult, + float2* __restrict d_PutResult, + float2* __restrict d_StockPrice, + float2* __restrict d_OptionStrike, + float2* __restrict d_OptionYears, float Riskfree, + float Volatility, int optN) { ////Thread index // const int tid = blockDim.x * blockIdx.x + threadIdx.x; ////Total number of threads in execution grid