Skip to content

Commit 0abfdc0

Browse files
committed
Hot fix for windows build; don't include <dlfcn.h> in 'hipblas_instance.h'
Signed-off-by: Anatoly Myachev <[email protected]>
1 parent ac5a15e commit 0abfdc0

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

third_party/amd/include/hipblas_instance.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
#define TRITON_HIPBLAS_INSTANCE_H
33

44
#include "hipblas_types.h"
5+
#ifdef WIN32
6+
#define WIN32_LEAN_AND_MEAN
7+
#define NOMINMAX
8+
#include <windows.h>
9+
#else
510
#include <dlfcn.h>
11+
#endif
612
#include <sstream>
713
#include <stdexcept>
814
#include <string>
@@ -70,6 +76,9 @@ class HipblasLtInstance {
7076
hipblasLtMatmulPreference_t preference = NULL;
7177

7278
void loadHipBlasDylib() {
79+
#ifdef WIN32
80+
assert(0 && "Not implemented on Windows");
81+
#else
7382
if (dylibHandle == nullptr) {
7483
// First reuse the existing handle
7584
dylibHandle = dlopen(name, RTLD_NOLOAD);
@@ -116,9 +125,16 @@ class HipblasLtInstance {
116125
std::string(name) +
117126
"`: " + std::string(dlsym_error));
118127
}
128+
#endif
119129
}
120130

121-
void unloadHipBlasDylib() { dlclose(dylibHandle); }
131+
void unloadHipBlasDylib() {
132+
#ifdef WIN32
133+
assert(0 && "Not implemented on Windows");
134+
#else
135+
dlclose(dylibHandle);
136+
#endif
137+
}
122138

123139
void successOrExit(hipblasStatus_t status, const std::string &context = "") {
124140
if (status != HIPBLAS_STATUS_SUCCESS) {

0 commit comments

Comments
 (0)