跳到主要内容

muRAND Host API 参考


目录​


Files​


Modules​


File murand.h​

Location: murand.h

Includes​

  • <musa.h>
  • murand_discrete_types.h
  • murand_version.h

Included by​

Macros​

Macro MURAND_DEFAULT_MAX_BLOCK_SIZE​

#define MURAND_DEFAULT_MAX_BLOCK_SIZE

Enumeration types​

Enumeration type murandStatus​

enum murandStatus \{ /` ... `/ \}

Enumeration type murandRngType​

enum murandRngType \{ /` ... `/ \}

Enumeration type murandOrdering​

enum murandOrdering \{ /` ... `/ \}

Enumeration type murandDirectionVectorSet​

enum murandDirectionVectorSet \{ /` ... `/ \}

Typedefs​

Typedef murandStatus_t​

Typedef murandRngType_t​

Typedef murandOrdering_t​

Functions​

Function murandCreateGenerator​

Function murandDestroyGenerator​

Function murandGenerate​

Function murandGenerateLongLong​

Function murandGenerateUniform​

Function murandGenerateUniformDouble​

Function murandGenerateNormal​

Function murandGenerateNormalDouble​

Function murandGenerateLogNormal​

Function murandGenerateLogNormalDouble​

Function murandGeneratePoisson​

Function murandGenerateSeeds​

Function murandSetStream​

Function murandSetPseudoRandomGeneratorSeed​

Function murandSetGeneratorOffset​

Function murandSetGeneratorOrdering​

Function murandSetQuasiRandomGeneratorDimensions​

Function murandGetVersion​

Function murandGetProperty​

Function murandCreatePoissonDistribution​

Function murandCreateDiscreteDistribution​

Function murandDestroyDistribution​

Function murandCreateGeneratorHost​

Function murandGetDirectionVectors32​

Function murandGetScrambleConstants32​

Function murandGetDirectionVectors64​

Function murandGetScrambleConstants64​


File murand_mtgp32_host.h​

Location: murand\_mtgp32\_host.h

Includes​

  • <stdlib.h>
  • murand.h
  • murand_common.h
  • murand_mtgp32.h
  • musa.h
  • <stdio.h>

Macros​

Functions​

Function murandMakeMTGP32KernelState​

__host__ murandStatus_t murandMakeMTGP32KernelState(murandStateMtgp32_t `d_state, mtgp32_params_fast_t params[], mtgp32_kernel_params_t `k, int n, unsigned long long seed)

Initializes MTGP32 states.

Initializes MTGP32 states on the host-side by allocating a state array in host memory, initializes that array, and copies the result to device memory.

Parameters:

  • d_state: - Pointer to an array of states in device memory
  • params: - Pointer to an array of type mtgp32_params_fast_t in host memory
  • n: - Number of states to initialize
  • seed: - Seed value

Returns:

  • MURAND_STATUS_ALLOCATION_FAILED if states could not be initialized

  • MURAND_STATUS_SUCCESS if states are initialized

Parameters:

murandStateMtgp32_t d_state

  • mtgp32_params_fast_t params mtgp32_kernel_params_t k
  • int n
  • unsigned long long seed

Return type: host murandStatus_t

References:

Function murandMakeMTGP32Constants​

__host__ murandStatus_t murandMakeMTGP32Constants(const mtgp32_params_fast_t params[], mtgp32_kernel_params_t *p)

Loads parameters for MTGP32.

Loads parameters for use by kernel functions on the host-side and copies the results to the specified location in device memory.

NOTE: Not used as murandMakeMTGP32KernelState handles loading parameters into state.

Parameters:

  • params: - Pointer to an array of type mtgp32_params_fast_t in host memory
  • p: - Pointer to a mtgp32_kernel_params_t structure allocated in device memory

Returns:

  • MURAND_STATUS_ALLOCATION_FAILED if parameters could not be loaded

  • MURAND_STATUS_SUCCESS if parameters are loaded

Parameters:

  • const mtgp32_params_fast_t params mtgp32_kernel_params_t p

Return type: host murandStatus_t

References: