Debian Codegraph @

Samples/2_Concepts_and_Techniques/MC_EstimatePiInlineP/README.md

raw
1 # MC_EstimatePiInlineP - Monte Carlo Estimation of Pi (inline PRNG)
2
3 ## Description
4
5 This sample uses Monte Carlo simulation for Estimation of Pi (using inline PRNG). This sample also uses the NVIDIA CURAND library.
6
7 ## Key Concepts
8
9 Random Number Generator, Computational Finance, CURAND Library
10
11 ## Supported SM Architectures
12
13 [SM 5.0 ](https://developer.nvidia.com/cuda-gpus) [SM 5.2 ](https://developer.nvidia.com/cuda-gpus) [SM 5.3 ](https://developer.nvidia.com/cuda-gpus) [SM 6.0 ](https://developer.nvidia.com/cuda-gpus) [SM 6.1 ](https://developer.nvidia.com/cuda-gpus) [SM 7.0 ](https://developer.nvidia.com/cuda-gpus) [SM 7.2 ](https://developer.nvidia.com/cuda-gpus) [SM 7.5 ](https://developer.nvidia.com/cuda-gpus) [SM 8.0 ](https://developer.nvidia.com/cuda-gpus) [SM 8.6 ](https://developer.nvidia.com/cuda-gpus) [SM 8.7 ](https://developer.nvidia.com/cuda-gpus) [SM 8.9 ](https://developer.nvidia.com/cuda-gpus) [SM 9.0 ](https://developer.nvidia.com/cuda-gpus)
14
15 ## Supported OSes
16
17 Linux, Windows
18
19 ## Supported CPU Architecture
20
21 x86_64, ppc64le, armv7l
22
23 ## CUDA APIs involved
24
25 ### [CUDA Runtime API](http://docs.nvidia.com/cuda/cuda-runtime-api/index.html)
26 cudaMemcpy, cudaGetErrorString, cudaFree, cudaSetDevice, cudaGetDeviceCount, cudaMalloc, cudaFuncGetAttributes, cudaGetDeviceProperties
27
28 ## Dependencies needed to build/run
29 [CURAND](../../../README.md#curand)
30
31 ## Prerequisites
32
33 Download and install the [CUDA Toolkit 12.5](https://developer.nvidia.com/cuda-downloads) for your corresponding platform.
34 Make sure the dependencies mentioned in [Dependencies]() section above are installed.
35
36 ## Build and Run
37
38 ### Windows
39 The Windows samples are built using the Visual Studio IDE. Solution files (.sln) are provided for each supported version of Visual Studio, using the format:
40 ```
41 *_vs<version>.sln - for Visual Studio <version>
42 ```
43 Each individual sample has its own set of solution files in its directory:
44
45 To build/examine all the samples at once, the complete solution files should be used. To build/examine a single sample, the individual sample solution files should be used.
46 > **Note:** Some samples require that the Microsoft DirectX SDK (June 2010 or newer) be installed and that the VC++ directory paths are properly set up (**Tools > Options...**). Check DirectX Dependencies section for details."
47
48 ### Linux
49 The Linux samples are built using makefiles. To use the makefiles, change the current directory to the sample directory you wish to build, and run make:
50 ```
51 $ cd <sample_dir>
52 $ make
53 ```
54 The samples makefiles can take advantage of certain options:
55 * **TARGET_ARCH=<arch>** - cross-compile targeting a specific architecture. Allowed architectures are x86_64, ppc64le, armv7l.
56 By default, TARGET_ARCH is set to HOST_ARCH. On a x86_64 machine, not setting TARGET_ARCH is the equivalent of setting TARGET_ARCH=x86_64.<br/>
57 `$ make TARGET_ARCH=x86_64` <br/> `$ make TARGET_ARCH=ppc64le` <br/> `$ make TARGET_ARCH=armv7l` <br/>
58 See [here](http://docs.nvidia.com/cuda/cuda-samples/index.html#cross-samples) for more details.
59 * **dbg=1** - build with debug symbols
60 ```
61 $ make dbg=1
62 ```
63 * **SMS="A B ..."** - override the SM architectures for which the sample will be built, where `"A B ..."` is a space-delimited list of SM architectures. For example, to generate SASS for SM 50 and SM 60, use `SMS="50 60"`.
64 ```
65 $ make SMS="50 60"
66 ```
67
68 * **HOST_COMPILER=<host_compiler>** - override the default g++ host compiler. See the [Linux Installation Guide](http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#system-requirements) for a list of supported host compilers.
69 ```
70 $ make HOST_COMPILER=g++
71 ```
72
73 ## References (for more details)
74