Skip to content

Commit

Permalink
Expose TORCH_XPU_API to Pytorch
Browse files Browse the repository at this point in the history
  • Loading branch information
etaf committed Jul 30, 2024
1 parent 8226837 commit b150b98
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/ATen/xpu/EmptyTensor.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#define TORCH_ASSERT_NO_OPERATORS
#include <ATen/Context.h>
#include <ATen/EmptyTensor.h>
#include <ATen/xpu/EmptyTensor.h>
#include <c10/core/Allocator.h>
#include <c10/core/DeviceGuard.h>

Expand Down
14 changes: 7 additions & 7 deletions src/ATen/xpu/EmptyTensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,38 @@

namespace at::detail {

// XXX: add TORCH_XPU_API
TensorBase empty_xpu(
TORCH_XPU_API TensorBase empty_xpu(
IntArrayRef size,
ScalarType dtype,
c10::optional<Device> device_opt,
c10::optional<c10::MemoryFormat> memory_format_opt);

TensorBase empty_xpu(
TORCH_XPU_API TensorBase empty_xpu(
IntArrayRef size,
c10::optional<ScalarType> dtype_opt,
c10::optional<Layout> layout_opt,
c10::optional<Device> device_opt,
c10::optional<bool> pin_memory_opt,
c10::optional<c10::MemoryFormat> memory_format_opt);

TensorBase empty_xpu(IntArrayRef size, const TensorOptions& options);
TORCH_XPU_API TensorBase
empty_xpu(IntArrayRef size, const TensorOptions& options);

TensorBase empty_strided_xpu(
TORCH_XPU_API TensorBase empty_strided_xpu(
IntArrayRef size,
IntArrayRef stride,
ScalarType dtype,
c10::optional<Device> device_opt);

TensorBase empty_strided_xpu(
TORCH_XPU_API TensorBase empty_strided_xpu(
IntArrayRef size,
IntArrayRef stride,
c10::optional<ScalarType> dtype_opt,
c10::optional<Layout> layout_opt,
c10::optional<Device> device_opt,
c10::optional<bool> pin_memory_opt);

TensorBase empty_strided_xpu(
TORCH_XPU_API TensorBase empty_strided_xpu(
IntArrayRef size,
IntArrayRef stride,
const TensorOptions& options);
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ include(${TORCH_XPU_OPS_ROOT}/cmake/Codegen.cmake)
set(ATen_XPU_CPP_SRCS)
set(ATen_XPU_SYCL_SRCS)

set(ATen_XPU_INCLUDE_DIRS ${TORCH_XPU_OPS_ROOT}/src)
set(ATen_XPU_INCLUDE_DIRS ${TORCH_XPU_OPS_ROOT}/src CACHE STRING "ATen XPU Include directory")

add_subdirectory(ATen)

Expand Down

0 comments on commit b150b98

Please sign in to comment.