Skip to content

Commit 71d03e5

Browse files
Geramyclaude
andcommitted
[ROCm] Add hip_kernel stub to no_rocm.cpp to fix undefined symbol
When MLX_BUILD_ROCM=OFF, the Python binding unconditionally references mlx::core::fast::hip_kernel but no_rocm.cpp only stubbed rocm::is_available(). Add a throwing stub matching the pattern used by no_metal.cpp and no_cuda.cpp. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a866ff4 commit 71d03e5

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

mlx/backend/rocm/no_rocm.cpp

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,31 @@
11
// Copyright © 2025 Apple Inc.
22

33
#include "mlx/backend/rocm/rocm.h"
4+
#include "mlx/fast.h"
45

5-
namespace mlx::core::rocm {
6+
namespace mlx::core {
7+
8+
namespace rocm {
69

710
bool is_available() {
811
return false;
912
}
1013

11-
} // namespace mlx::core::rocm
14+
} // namespace rocm
15+
16+
namespace fast {
17+
18+
CustomKernelFunction hip_kernel(
19+
const std::string&,
20+
const std::vector<std::string>&,
21+
const std::vector<std::string>&,
22+
const std::string&,
23+
const std::string&,
24+
bool,
25+
int) {
26+
throw std::runtime_error("[hip_kernel] No ROCm back-end.");
27+
}
28+
29+
} // namespace fast
30+
31+
} // namespace mlx::core

0 commit comments

Comments
 (0)