Home / Class/ PointerModeGuard Class — pytorch Architecture

PointerModeGuard Class — pytorch Architecture

Architecture documentation for the PointerModeGuard class in CUDABlas.h from the pytorch codebase.

Entity Profile

Source Code

aten/src/ATen/cuda/CUDABlas.h lines 24–39

class PointerModeGuard {
public:
  PointerModeGuard(cublasHandle_t handle, cublasPointerMode_t mode) :
      handle(handle) {
    TORCH_CUDABLAS_CHECK(cublasGetPointerMode(handle, &previous_mode));
    TORCH_CUDABLAS_CHECK(cublasSetPointerMode(handle, mode));
  }

  ~PointerModeGuard() {
    cublasSetPointerMode(handle, previous_mode);
  }

private:
  cublasHandle_t handle;
  cublasPointerMode_t previous_mode{};
};

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free