Skip to content

Commit

Permalink
Remove GatheredContextSupplier.java
Browse files Browse the repository at this point in the history
  • Loading branch information
HGuillemet committed Oct 25, 2023
1 parent 0704e7a commit 2d234ac
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ public native void beginAllocateStreamToPool(
public native @Cast("bool") boolean isHistoryEnabled();
public native void recordHistory(
@Cast("bool") boolean enabled,
GatheredContextSupplier context_recorder,
@ByVal @Cast("c10::cuda::CUDACachingAllocator::CreateContextFn*") Pointer context_recorder,
@Cast("size_t") long alloc_trace_max_entries,
RecordContext when);
public native void recordHistory(
@Cast("bool") boolean enabled,
GatheredContextSupplier context_recorder,
@ByVal @Cast("c10::cuda::CUDACachingAllocator::CreateContextFn*") Pointer context_recorder,
@Cast("size_t") long alloc_trace_max_entries,
@Cast("c10::cuda::CUDACachingAllocator::RecordContext") int when);
public native void attachOutOfMemoryObserver(@ByVal @Cast("c10::cuda::CUDACachingAllocator::OutOfMemoryObserver*") Pointer observer);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ public void map(InfoMap infoMap) {
.put(new Info("const std::vector<c10::cuda::CUDACachingAllocator::TraceEntry>", "std::vector<c10::cuda::CUDACachingAllocator::TraceEntry>").pointerTypes("TraceEntryVector").define())

//// Function pointers
.put(new Info("std::shared_ptr<c10::GatheredContext> (*)()", "c10::cuda::CUDACachingAllocator::CreateContextFn").pointerTypes("GatheredContextSupplier").valueTypes("GatheredContextSupplier").skip())
// Function pointer returning shared_ptr don't compile on windows
// "D:\a\javacpp-presets\javacpp-presets\pytorch\target\native\org\bytedeco\pytorch\windows-x86_64\jnitorch.cpp(98904): error C2526: 'JavaCPP_org_bytedeco_pytorch_functions_GatheredContextSupplier_allocate_callback': C linkage function cannot return C++ class 'std::shared_ptr<c10::GatheredContext>'"
//.put(new Info("std::shared_ptr<c10::GatheredContext> (*)()", "c10::cuda::CUDACachingAllocator::CreateContextFn").pointerTypes("GatheredContextSupplier").valueTypes("GatheredContextSupplier").skip())
;

//// Avoiding name clashes by skipping or renaming
Expand Down Expand Up @@ -157,7 +159,9 @@ public void map(InfoMap infoMap) {
"at::native::Descriptor<cudnnSpatialTransformerStruct,cudnnCreateSpatialTransformerDescriptor&,cudnnDestroySpatialTransformerDescriptor&>",
"at::native::Descriptor<cudnnTensorStruct,cudnnCreateTensorDescriptor&,cudnnDestroyTensorDescriptor&>",

"std::hash<c10::cuda::CUDAStream>"
"std::hash<c10::cuda::CUDAStream>",

"std::shared_ptr<c10::CreateContextFn> (*)()", "c10::cuda::CUDACachingAllocator::CreateContextFn" // See comment for GatheredContextSupplier

).cast().pointerTypes("Pointer"))

Expand Down

0 comments on commit 2d234ac

Please sign in to comment.