MCPcopy Create free account
hub / github.com/DeepGraphLearning/graphvite / SamplerMixin

Method SamplerMixin

include/core/solver.h:943–954  ·  view source on GitHub ↗

* Construct a general edge sampler * @param _solver pointer to graph embedding solver * @param _device_id GPU id */

Source from the content-addressed store, hash-verified

941 * @param _device_id GPU id
942 */
943 SamplerMixin(Solver *_solver, int _device_id) :
944 solver(_solver), device_id(_device_id), random(device_id) {
945 CUDA_CHECK(cudaSetDevice(device_id));
946
947 CUDA_CHECK(cudaStreamCreate(&stream));
948
949 random.stream = stream;
950 CURAND_CHECK(curandCreateGenerator(&generator, CURAND_RNG_PSEUDO_DEFAULT));
951 std::uniform_int_distribution<unsigned long long> random_seed(0, ULLONG_MAX);
952 CURAND_CHECK(curandSetPseudoRandomGeneratorSeed(generator, random_seed(seed)));
953 CURAND_CHECK(curandSetStream(generator, stream));
954 }
955
956 /** Should return the additional attributes */
957 virtual Attributes get_attributes(const Edge &edge) const = 0;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected