MCPcopy Create free account
hub / github.com/colmap/colmap / FillWithRandomNumbersKernel

Function FillWithRandomNumbersKernel

src/colmap/mvs/gpu_mat.h:372–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370
371template <typename T>
372__global__ void FillWithRandomNumbersKernel(
373 GpuMatView<T> output,
374 GpuMatView<curandState> random_state,
375 const T min_value,
376 const T max_value) {
377 const size_t row = blockIdx.y * blockDim.y + threadIdx.y;
378 const size_t col = blockIdx.x * blockDim.x + threadIdx.x;
379 if (row < output.GetHeight() && col < output.GetWidth()) {
380 curandState local_state = random_state.Get(row, col);
381 for (size_t slice = 0; slice < output.GetDepth(); ++slice) {
382 const T random_value =
383 curand_uniform(&local_state) * (max_value - min_value) + min_value;
384 output.Set(row, col, slice, random_value);
385 }
386 random_state.Set(row, col, local_state);
387 }
388}
389
390} // namespace internal
391

Callers

nothing calls this directly

Calls 5

GetHeightMethod · 0.45
GetWidthMethod · 0.45
GetMethod · 0.45
GetDepthMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected