Skip to content

Commit

Permalink
[Windows] add missing symbol export (#2556)
Browse files Browse the repository at this point in the history
* add missing symbol export

* more missing exports

* fix format issues

---------

Co-authored-by: Jun Liu <Liu.Jun@amd.com>
Co-authored-by: Alex Eremin <CAHEK7@yandex.ru>
  • Loading branch information
3 people authored Dec 26, 2023
1 parent 25a399f commit 1cc63e2
Show file tree
Hide file tree
Showing 19 changed files with 37 additions and 21 deletions.
1 change: 1 addition & 0 deletions src/activ_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ extern "C" miopenStatus_t miopenGetActivationDescriptor(miopenActivationDescript
}

namespace miopen::debug {
MIOPEN_EXPORT
void LogCmdActivation(const miopen::TensorDescriptor& x_desc,
const miopen::ActivationDescriptor& activ_desc,
bool fwd)
Expand Down
3 changes: 2 additions & 1 deletion src/execution_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ MIOPEN_DECLARE_ENV_VAR_BOOL(MIOPEN_DEBUG_AMD_ROCM_METADATA_PREFER_OLDER)
namespace miopen {
namespace debug {

bool IsWarmupOngoing = false; // NOLINT (cppcoreguidelines-avoid-non-const-global-variables)
// NOLINTNEXTLINE (cppcoreguidelines-avoid-non-const-global-variables)
MIOPEN_EXPORT bool IsWarmupOngoing = false;

} // namespace debug
} // namespace miopen
Expand Down
3 changes: 2 additions & 1 deletion src/find_controls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ namespace miopen {

namespace debug {

bool FindEnforceDisable = false; // NOLINT (cppcoreguidelines-avoid-non-const-global-variables)
// NOLINTNEXTLINE (cppcoreguidelines-avoid-non-const-global-variables)
MIOPEN_EXPORT bool FindEnforceDisable = false;

} // namespace debug

Expand Down
3 changes: 2 additions & 1 deletion src/find_db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ namespace miopen {

namespace debug {

bool testing_find_db_enabled = true; // NOLINT (cppcoreguidelines-avoid-non-const-global-variables)
// NOLINTNEXTLINE (cppcoreguidelines-avoid-non-const-global-variables)
MIOPEN_EXPORT bool testing_find_db_enabled = true;

/// \todo Remove when #1723 is resolved.
boost::optional<std::string>& testing_find_db_path_override()
Expand Down
2 changes: 2 additions & 0 deletions src/include/miopen/conv_algo_name.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include <string>
#include <miopen/errors.hpp>
#include <miopen/export.h>

namespace miopen {

Expand All @@ -46,6 +47,7 @@ miopenConvFwdAlgorithm_t StringToConvolutionFwdAlgo(const std::string& s);
miopenConvBwdDataAlgorithm_t StringToConvolutionBwdDataAlgo(const std::string& s);
miopenConvBwdWeightsAlgorithm_t StringToConvolutionBwdWeightsAlgo(const std::string& s);

MIOPEN_EXPORT
std::string ConvolutionAlgoToString(miopenConvAlgorithm_t algo);
std::string ConvolutionAlgoToDirectionalString(miopenConvAlgorithm_t algo, conv::Direction dir);

Expand Down
2 changes: 1 addition & 1 deletion src/include/miopen/convolution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ struct ConvolutionAttribute
friend void from_json(const nlohmann::json& json, ConvolutionAttribute& conv);
};

struct ConvolutionDescriptor : miopenConvolutionDescriptor
struct MIOPEN_EXPORT ConvolutionDescriptor : miopenConvolutionDescriptor
{
ConvolutionDescriptor(std::size_t spatial_dim,
miopenConvolutionMode_t c_mode,
Expand Down
3 changes: 2 additions & 1 deletion src/include/miopen/execution_context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ namespace debug {
/// is in progress. The library can use this, for example, to disable some
/// workarounds that would affect warm-up otherwise.
/// WARNING: This switch is not intended for use in multi-threaded applications.
extern bool IsWarmupOngoing; // NOLINT (cppcoreguidelines-avoid-non-const-global-variables)
MIOPEN_EXPORT extern bool
IsWarmupOngoing; // NOLINT (cppcoreguidelines-avoid-non-const-global-variables)

} // namespace debug

Expand Down
3 changes: 2 additions & 1 deletion src/include/miopen/find_controls.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ namespace debug {
/// Disable MIOPEN_FIND_ENFORCE. Intended for debugging/testing purposes.
/// Currently used during warm-up phase in MIOpenDriver.
/// WARNING: This switch is not intended for use in multi-threaded applications.
extern bool FindEnforceDisable; // NOLINT (cppcoreguidelines-avoid-non-const-global-variables)
MIOPEN_EXPORT extern bool
FindEnforceDisable; // NOLINT (cppcoreguidelines-avoid-non-const-global-variables)

} // namespace debug

Expand Down
5 changes: 3 additions & 2 deletions src/include/miopen/find_db.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ using UserFindDbRecord = FindDbRecord_t<UserFindDb>;
namespace debug {

// For unit tests.
extern bool testing_find_db_enabled; // NOLINT (cppcoreguidelines-avoid-non-const-global-variables)
extern boost::optional<std::string>&
MIOPEN_EXPORT extern bool
testing_find_db_enabled; // NOLINT (cppcoreguidelines-avoid-non-const-global-variables)
MIOPEN_EXPORT extern boost::optional<std::string>&
testing_find_db_path_override(); /// \todo Remove when #1723 is resolved.

} // namespace debug
Expand Down
2 changes: 2 additions & 0 deletions src/include/miopen/gemm_v2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ miopenStatus_t CallGemmTimeMeasure(const Handle& handle,
CallGemmType_t call_gemm_type,
GemmBackend_t gemm_backend = GemmBackend_t::rocblas);

MIOPEN_EXPORT
miopenStatus_t CallGemm(const Handle& handle,
GemmDescriptor gemm_desc,
ConstData_t A,
Expand All @@ -143,6 +144,7 @@ miopenStatus_t CallGemm(const Handle& handle,
std::size_t c_offset,
GemmBackend_t gemm_backend = GemmBackend_t::rocblas);

MIOPEN_EXPORT
miopenStatus_t CallGemmStridedBatched(const Handle& handle,
GemmDescriptor gemm_desc,
ConstData_t A,
Expand Down
2 changes: 1 addition & 1 deletion src/include/miopen/handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct HandleImpl;
using rocblas_handle_ptr = MIOPEN_MANAGE_PTR(rocblas_handle, rocblas_destroy_handle);
#endif

struct Handle : miopenHandle
struct MIOPEN_EXPORT Handle : miopenHandle
{
friend struct TargetProperties;

Expand Down
11 changes: 7 additions & 4 deletions src/include/miopen/logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <miopen/each_args.hpp>
#include <miopen/object.hpp>
#include <miopen/config.h>
#include <miopen/export.h>

#if MIOPEN_USE_ROCTRACER
#include <roctracer/roctx.h>
Expand Down Expand Up @@ -212,16 +213,17 @@ namespace debug {
/// by MIOPEN_LOG_NQ* macros (that ignore this switch).
///
/// WARNING: This switch is not intended for use in multi-threaded applications.
extern bool LoggingQuiet; // NOLINT (cppcoreguidelines-avoid-non-const-global-variables)
MIOPEN_EXPORT extern bool
LoggingQuiet; // NOLINT (cppcoreguidelines-avoid-non-const-global-variables)

} // namespace debug

const char* LoggingLevelToCString(LoggingLevel level);
std::string LoggingPrefix();
MIOPEN_EXPORT const char* LoggingLevelToCString(LoggingLevel level);
MIOPEN_EXPORT std::string LoggingPrefix();

/// \return true if level is enabled.
/// \param level - one of the values defined in LoggingLevel.
bool IsLogging(LoggingLevel level, bool disableQuieting = false);
MIOPEN_EXPORT bool IsLogging(LoggingLevel level, bool disableQuieting = false);
bool IsLoggingCmd();
bool IsLoggingFunctionCalls();
#if MIOPEN_USE_ROCTRACER
Expand Down Expand Up @@ -345,6 +347,7 @@ LogParam(std::ostream& os, std::string name, const std::vector<T>& vec, bool ind
#define MIOPEN_LOG_FUNCTION(...)
#endif

MIOPEN_EXPORT
std::string LoggingParseFunction(const char* func, const char* pretty_func);

#define MIOPEN_GET_FN_NAME() \
Expand Down
2 changes: 1 addition & 1 deletion src/include/miopen/pooling.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ inline std::string get_pooling_index_type_max_name(miopenIndexType_t index_type)
struct Handle;
struct TensorDescriptor;

struct PoolingDescriptor : miopenPoolingDescriptor
struct MIOPEN_EXPORT PoolingDescriptor : miopenPoolingDescriptor
{
PoolingDescriptor();

Expand Down
2 changes: 1 addition & 1 deletion src/include/miopen/solver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace debug {
/// If set to true, then always enable ConvDirectNaive* solver, regardless of environment value
/// MIOPEN_DEBUG_CONV_DIRECT_NAIVE_CONV_* that control enable/disable of these solvers.
/// Currently used during driver using naive kernel as gpu reference.
extern bool
MIOPEN_EXPORT extern bool
AlwaysEnableConvDirectNaive; // NOLINT (cppcoreguidelines-avoid-non-const-global-variables)

} // namespace debug
Expand Down
2 changes: 1 addition & 1 deletion src/include/miopen/solver_id.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ enum class Primitive
Reduce
};

struct Id
struct MIOPEN_EXPORT Id
{
static constexpr uint64_t invalid_value = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/include/miopen/tensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ std::ptrdiff_t integer_division_ceil(X x, Y y)
return (tx + ty - 1) / ty;
}

struct TensorDescriptor : miopenTensorDescriptor
struct MIOPEN_EXPORT TensorDescriptor : miopenTensorDescriptor
{
TensorDescriptor();

Expand Down
3 changes: 2 additions & 1 deletion src/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ namespace miopen {

namespace debug {

bool LoggingQuiet = false; // NOLINT (cppcoreguidelines-avoid-non-const-global-variables)
// NOLINTNEXTLINE (cppcoreguidelines-avoid-non-const-global-variables)
MIOPEN_EXPORT bool LoggingQuiet = false;

} // namespace debug

Expand Down
2 changes: 1 addition & 1 deletion src/solver/conv_direct_naive_conv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace miopen {

namespace debug {
// NOLINTNEXTLINE (cppcoreguidelines-avoid-non-const-global-variables)
bool AlwaysEnableConvDirectNaive = false;
MIOPEN_EXPORT bool AlwaysEnableConvDirectNaive = false;

} // namespace debug

Expand Down
5 changes: 3 additions & 2 deletions test/gpu_conv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@
namespace miopen {
namespace debug {

extern bool
MIOPEN_EXPORT extern bool
AlwaysEnableConvDirectNaive; // NOLINT (cppcoreguidelines-avoid-non-const-global-variables)
extern bool LoggingQuiet; // NOLINT (cppcoreguidelines-avoid-non-const-global-variables)
MIOPEN_EXPORT extern bool
LoggingQuiet; // NOLINT (cppcoreguidelines-avoid-non-const-global-variables)

} // namespace debug
} // namespace miopen
Expand Down

0 comments on commit 1cc63e2

Please sign in to comment.