Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【paddle_test No.19】replace cc_test with paddle_test #61238

Merged
merged 21 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions paddle/phi/backends/dynload/cudnn.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ limitations under the License. */
namespace phi {
namespace dynload {

extern std::once_flag cudnn_dso_flag;
extern void* cudnn_dso_handle;
TEST_API extern std::once_flag cudnn_dso_flag;
TEST_API extern void* cudnn_dso_handle;
extern bool HasCUDNN();

extern void EnforceCUDNNLoaded(const char* fn_name);
TEST_API extern void EnforceCUDNNLoaded(const char* fn_name);
#define DECLARE_DYNAMIC_LOAD_CUDNN_WRAP(__name) \
struct DynLoad__##__name { \
template <typename... Args> \
Expand Down
4 changes: 2 additions & 2 deletions paddle/phi/backends/dynload/dynamic_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ limitations under the License. */

#pragma once
#include <string>

#include "paddle/utils/test_macros.h"
namespace phi {
namespace dynload {

Expand All @@ -26,7 +26,7 @@ namespace dynload {

void* GetCublasDsoHandle();
void* GetCublasLtDsoHandle();
void* GetCUDNNDsoHandle();
TEST_API void* GetCUDNNDsoHandle();
void* GetCUPTIDsoHandle();
void* GetCurandDsoHandle();
void* GetNvjpegDsoHandle();
Expand Down
3 changes: 2 additions & 1 deletion paddle/phi/backends/dynload/port.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#pragma once

#include <string>
#include "paddle/utils/test_macros.h"

#define GLOG_NO_ABBREVIATED_SEVERITIES // msvc conflict logging with windows.h

Expand All @@ -38,7 +39,7 @@
#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR)
#endif // S_ISDIR

void *dlsym(void *handle, const char *symbol_name);
TEST_API void *dlsym(void *handle, const char *symbol_name);

void *dlopen(const char *filename, int flag);

Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/backends/gpu/gpu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class DnnWorkspaceHandle {

void ResetWorkspace();

void ReallocWorkspace(size_t required_workspace_bytes);
TEST_API void ReallocWorkspace(size_t required_workspace_bytes);

DnnWorkspaceHandle(DnnWorkspaceHandle&&) = default;
DnnWorkspaceHandle& operator=(DnnWorkspaceHandle&&) = delete;
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/core/device_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ T* DeviceContext::HostAlloc(TensorBase* tensor, size_t requested_size) const {
}

#define DEVICE_CONTEXT_MEMBER_FUNC_INSTANTIATION(dtype) \
template dtype* DeviceContext::Alloc( \
template TEST_API dtype* DeviceContext::Alloc( \
TensorBase* tensor, size_t requested_size, bool pinned) const; \
template dtype* DeviceContext::HostAlloc(TensorBase* tensor, \
size_t requested_size) const;
Expand Down
6 changes: 3 additions & 3 deletions paddle/phi/core/device_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ class PADDLE_API DeviceContext {
bool fake_alloc = false) const;

template <typename T>
T* Alloc(TensorBase* tensor,
size_t requested_size = 0,
bool pinned = false) const;
TEST_API T* Alloc(TensorBase* tensor,
size_t requested_size = 0,
bool pinned = false) const;

/**
* @brief Allocate host memory for tensor.
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/core/enforce.h
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ DEFINE_EXTERNAL_API_TYPE(ncclResult_t, ncclSuccess);
} // namespace details

template <typename T>
std::string GetExternalErrorMsg(T status);
TEST_API std::string GetExternalErrorMsg(T status);

/*************** CUDA ERROR ***************/
inline bool is_error(cudaError_t e) { return e != cudaSuccess; }
Expand Down
18 changes: 3 additions & 15 deletions test/cpp/fluid/fused/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
if(WITH_GPU OR WITH_ROCM)
# fusion_group
if(NOT APPLE AND NOT WIN32)
cc_test(
test_fusion_group_op
SRCS fusion_group_op_test.cc
DEPS fusion_group_op)
paddle_test(test_fusion_group_op SRCS fusion_group_op_test.cc)
endif()
if(NOT WITH_ROCM)
nv_test(
Expand Down Expand Up @@ -42,7 +39,7 @@ if(WITH_GPU OR WITH_ROCM)
endif()
# resnet_unit needs cudnn 8.0 above
if((NOT WITH_ROCM) AND (NOT ${CUDNN_VERSION} VERSION_LESS 8000))
cc_test(
nv_test(
test_cudnn_norm_conv
SRCS cudnn_norm_conv_test.cc
DEPS generated_op
Expand All @@ -52,15 +49,6 @@ if(WITH_GPU OR WITH_ROCM)
device_context
phi
common)
cc_test(
test_cudnn_bn_add_relu
SRCS cudnn_bn_add_relu_test.cc
DEPS batch_norm_op
fused_bn_add_activation_op
tensor
op_registry
device_context
phi
common)
paddle_test(test_cudnn_bn_add_relu SRCS cudnn_bn_add_relu_test.cc)
endif()
endif()
7 changes: 0 additions & 7 deletions test/cpp/fluid/fused/cudnn_bn_add_relu_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ namespace framework = paddle::framework;
namespace platform = paddle::platform;
namespace op = paddle::operators;

USE_OP_ITSELF(batch_norm);
USE_OP_ITSELF(fused_bn_add_activation);
USE_OP_ITSELF(fused_bn_add_activation_grad);
PD_DECLARE_KERNEL(batch_norm, GPU, ALL_LAYOUT);
PD_DECLARE_KERNEL(fused_bn_add_activation, GPU, ALL_LAYOUT);
PD_DECLARE_KERNEL(fused_bn_add_activation_grad, GPU, ALL_LAYOUT);

template <typename T>
void InitRandomTensor(const std::vector<int64_t> &dims,
phi::DenseTensor *cpu_out) {
Expand Down