Skip to content

Commit eb8de72

Browse files
committed
Remove old registerDeviceInterface
1 parent 13fad10 commit eb8de72

File tree

5 files changed

+5
-19
lines changed

5 files changed

+5
-19
lines changed

src/torchcodec/_core/BetaCudaDeviceInterface.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ namespace facebook::torchcodec {
2727

2828
namespace {
2929

30-
// Register the BETA CUDA interface with 'beta' variant
3130
static bool g_cuda_beta = registerDeviceInterface(
32-
DeviceInterfaceKey(torch::kCUDA, "beta"),
31+
DeviceInterfaceKey(torch::kCUDA, /*variant=*/"beta"),
3332
[](const torch::Device& device) {
3433
return new BetaCudaDeviceInterface(device);
3534
});

src/torchcodec/_core/CpuDeviceInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace facebook::torchcodec {
1010
namespace {
1111

1212
static bool g_cpu = registerDeviceInterface(
13-
torch::kCPU,
13+
DeviceInterfaceKey(torch::kCPU),
1414
[](const torch::Device& device) { return new CpuDeviceInterface(device); });
1515

1616
} // namespace

src/torchcodec/_core/CudaDeviceInterface.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ extern "C" {
2525
namespace facebook::torchcodec {
2626
namespace {
2727

28-
static bool g_cuda =
29-
registerDeviceInterface(torch::kCUDA, [](const torch::Device& device) {
28+
static bool g_cuda = registerDeviceInterface(
29+
DeviceInterfaceKey(torch::kCUDA),
30+
[](const torch::Device& device) {
3031
return new CudaDeviceInterface(device);
3132
});
3233

src/torchcodec/_core/DeviceInterface.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,6 @@ bool registerDeviceInterface(
4848
return true;
4949
}
5050

51-
bool registerDeviceInterface(
52-
torch::DeviceType deviceType,
53-
CreateDeviceInterfaceFn createInterface) {
54-
return registerDeviceInterface(
55-
DeviceInterfaceKey(deviceType), createInterface);
56-
}
57-
5851
void validateDeviceInterface(
5952
const std::string device,
6053
const std::string variant) {

src/torchcodec/_core/DeviceInterface.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,6 @@ bool registerDeviceInterface(
122122
const DeviceInterfaceKey& key,
123123
const CreateDeviceInterfaceFn createInterface);
124124

125-
// Backward-compatible registration function when variant is "default"
126-
// TODONVDEC P2 We only need this if someone in the wild has already started
127-
// registering their own interfaces. Ask Dmitry.
128-
bool registerDeviceInterface(
129-
torch::DeviceType deviceType,
130-
const CreateDeviceInterfaceFn createInterface);
131-
132125
void validateDeviceInterface(
133126
const std::string device,
134127
const std::string variant);

0 commit comments

Comments
 (0)