NVIDIA / NVIDIA/raft

[FEA] Add getDeviceCapability function

Open
#90 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

inactive-30d inactive-90d
Dominant language
Cuda
Stars
1k
Forks
251
Avg merge
1d 8h
Merged PRs (30d)
31

Description

Spawned from this cuML PR comment: https://github.com/rapidsai/cuml/pull/3058#discussion_r518439447

This is a simple utility method that would be good to have in raft.

#include <utility>  // pair

/** helper method to get the compute capability version numbers */
inline std::pair<int, int> getDeviceCapability() {
  int devId;
  CUDA_CHECK(cudaGetDevice(&devId));
  int major, minor;
  CUDA_CHECK(
    cudaDeviceGetAttribute(&major, cudaDevAttrComputeCapabilityMajor, devId));
  CUDA_CHECK(
    cudaDeviceGetAttribute(&minor, cudaDevAttrComputeCapabilityMinor, devId));
  return std::make_pair(major, minor);
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked cuML pull request discussion and review the surrounding RAFT CUDA utility conventions. Add the supplied getDeviceCapability helper at the appropriate existing utility entry point, returning the current device's major and minor compute capability with the shown CUDA error checks. Done means the helper is available and relevant existing CUDA tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.