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

[CUDA] Add cupti #1531

Merged
merged 8 commits into from
Aug 22, 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

* Add presets for the CUPTI module of CUDA ([pull #1531](https://github.com/bytedeco/javacpp-presets/pull/1531))
* Add new `ClangMemoryMgmtExample` in samples for LLVM ([pull #1522](https://github.com/bytedeco/javacpp-presets/pull/1522))
* Enable `opencv_python3` module for `macosx-arm64` as well ([pull #1517](https://github.com/bytedeco/javacpp-presets/pull/1517))
* Introduce `macosx-arm64` builds for CPython ([pull #1511](https://github.com/bytedeco/javacpp-presets/pull/1511)), NumPy ([pull #1515](https://github.com/bytedeco/javacpp-presets/pull/1515)), SciPy ([pull #1516](https://github.com/bytedeco/javacpp-presets/pull/1516))
Expand Down
51 changes: 51 additions & 0 deletions cuda/src/gen/java/org/bytedeco/cuda/cupti/CUpti_Activity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.cuda.cupti;

import java.nio.*;
import org.bytedeco.javacpp.*;
import org.bytedeco.javacpp.annotation.*;

import static org.bytedeco.javacpp.presets.javacpp.*;
import org.bytedeco.cuda.cudart.*;
import static org.bytedeco.cuda.global.cudart.*;

import static org.bytedeco.cuda.global.cupti.*;


/**
* \brief The base activity record.
*
* The activity API uses a CUpti_Activity as a generic representation
* for any activity. The 'kind' field is used to determine the
* specific activity kind, and from that the CUpti_Activity object can
* be cast to the specific activity record type appropriate for that kind.
*
* Note that all activity record types are padded and aligned to
* ensure that each member of the record is naturally aligned.
*
* @see CUpti_ActivityKind
*/
@Properties(inherit = org.bytedeco.cuda.presets.cupti.class)
public class CUpti_Activity extends Pointer {
static { Loader.load(); }
/** Default native constructor. */
public CUpti_Activity() { super((Pointer)null); allocate(); }
/** Native array allocator. Access with {@link Pointer#position(long)}. */
public CUpti_Activity(long size) { super((Pointer)null); allocateArray(size); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public CUpti_Activity(Pointer p) { super(p); }
private native void allocate();
private native void allocateArray(long size);
@Override public CUpti_Activity position(long position) {
return (CUpti_Activity)super.position(position);
}
@Override public CUpti_Activity getPointer(long i) {
return new CUpti_Activity((Pointer)this).offsetAddress(i);
}

/**
* The kind of this activity.
*/
public native @Cast("CUpti_ActivityKind") int kind(); public native CUpti_Activity kind(int setter);
}
92 changes: 92 additions & 0 deletions cuda/src/gen/java/org/bytedeco/cuda/cupti/CUpti_ActivityAPI.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.cuda.cupti;

import java.nio.*;
import org.bytedeco.javacpp.*;
import org.bytedeco.javacpp.annotation.*;

import static org.bytedeco.javacpp.presets.javacpp.*;
import org.bytedeco.cuda.cudart.*;
import static org.bytedeco.cuda.global.cudart.*;

import static org.bytedeco.cuda.global.cupti.*;


/**
* \brief The activity record for a driver or runtime API invocation.
*
* This activity record represents an invocation of a driver or
* runtime API (CUPTI_ACTIVITY_KIND_DRIVER and
* CUPTI_ACTIVITY_KIND_RUNTIME).
*/
@Properties(inherit = org.bytedeco.cuda.presets.cupti.class)
public class CUpti_ActivityAPI extends Pointer {
static { Loader.load(); }
/** Default native constructor. */
public CUpti_ActivityAPI() { super((Pointer)null); allocate(); }
/** Native array allocator. Access with {@link Pointer#position(long)}. */
public CUpti_ActivityAPI(long size) { super((Pointer)null); allocateArray(size); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public CUpti_ActivityAPI(Pointer p) { super(p); }
private native void allocate();
private native void allocateArray(long size);
@Override public CUpti_ActivityAPI position(long position) {
return (CUpti_ActivityAPI)super.position(position);
}
@Override public CUpti_ActivityAPI getPointer(long i) {
return new CUpti_ActivityAPI((Pointer)this).offsetAddress(i);
}

/**
* The activity record kind, must be CUPTI_ACTIVITY_KIND_DRIVER,
* CUPTI_ACTIVITY_KIND_RUNTIME, or CUPTI_ACTIVITY_KIND_INTERNAL_LAUNCH_API.
*/
public native @Cast("CUpti_ActivityKind") int kind(); public native CUpti_ActivityAPI kind(int setter);

/**
* The ID of the driver or runtime function.
*/
public native @Cast("CUpti_CallbackId") int cbid(); public native CUpti_ActivityAPI cbid(int setter);

/**
* The start timestamp for the function, in ns. A value of 0 for
* both the start and end timestamps indicates that timestamp
* information could not be collected for the function.
*/
public native @Cast("uint64_t") long start(); public native CUpti_ActivityAPI start(long setter);

/**
* The end timestamp for the function, in ns. A value of 0 for both
* the start and end timestamps indicates that timestamp information
* could not be collected for the function.
*/
public native @Cast("uint64_t") long end(); public native CUpti_ActivityAPI end(long setter);

/**
* The ID of the process where the driver or runtime CUDA function
* is executing.
*/
public native @Cast("uint32_t") int processId(); public native CUpti_ActivityAPI processId(int setter);

/**
* The ID of the thread where the driver or runtime CUDA function is
* executing.
*/
public native @Cast("uint32_t") int threadId(); public native CUpti_ActivityAPI threadId(int setter);

/**
* The correlation ID of the driver or runtime CUDA function. Each
* function invocation is assigned a unique correlation ID that is
* identical to the correlation ID in the memcpy, memset, or kernel
* activity record that is associated with this function.
*/
public native @Cast("uint32_t") int correlationId(); public native CUpti_ActivityAPI correlationId(int setter);

/**
* The return value for the function. For a CUDA driver function
* with will be a CUresult value, and for a CUDA runtime function
* this will be a cudaError_t value.
*/
public native @Cast("uint32_t") int returnValue(); public native CUpti_ActivityAPI returnValue(int setter);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.cuda.cupti;

import java.nio.*;
import org.bytedeco.javacpp.*;
import org.bytedeco.javacpp.annotation.*;

import static org.bytedeco.javacpp.presets.javacpp.*;
import org.bytedeco.cuda.cudart.*;
import static org.bytedeco.cuda.global.cudart.*;

import static org.bytedeco.cuda.global.cupti.*;


/**
* \brief Device auto boost state structure
*
* This structure defines auto boost state for a device.
* See function \ref cuptiGetAutoBoostState
*/
@Properties(inherit = org.bytedeco.cuda.presets.cupti.class)
public class CUpti_ActivityAutoBoostState extends Pointer {
static { Loader.load(); }
/** Default native constructor. */
public CUpti_ActivityAutoBoostState() { super((Pointer)null); allocate(); }
/** Native array allocator. Access with {@link Pointer#position(long)}. */
public CUpti_ActivityAutoBoostState(long size) { super((Pointer)null); allocateArray(size); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public CUpti_ActivityAutoBoostState(Pointer p) { super(p); }
private native void allocate();
private native void allocateArray(long size);
@Override public CUpti_ActivityAutoBoostState position(long position) {
return (CUpti_ActivityAutoBoostState)super.position(position);
}
@Override public CUpti_ActivityAutoBoostState getPointer(long i) {
return new CUpti_ActivityAutoBoostState((Pointer)this).offsetAddress(i);
}

/**
* Returned auto boost state. 1 is returned in case auto boost is enabled, 0
* otherwise
*/
public native @Cast("uint32_t") int enabled(); public native CUpti_ActivityAutoBoostState enabled(int setter);

/**
* Id of process that has set the current boost state. The value will be
* CUPTI_AUTO_BOOST_INVALID_CLIENT_PID if the user does not have the
* permission to query process ids or there is an error in querying the
* process id.
*/
public native @Cast("uint32_t") int pid(); public native CUpti_ActivityAutoBoostState pid(int setter);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.cuda.cupti;

import java.nio.*;
import org.bytedeco.javacpp.*;
import org.bytedeco.javacpp.annotation.*;

import static org.bytedeco.javacpp.presets.javacpp.*;
import org.bytedeco.cuda.cudart.*;
import static org.bytedeco.cuda.global.cudart.*;

import static org.bytedeco.cuda.global.cupti.*;


/**
* \brief The activity record for source level result
* branch.
*
* This activity record the locations of the branches in the
* source (CUPTI_ACTIVITY_KIND_BRANCH).
*/
@Properties(inherit = org.bytedeco.cuda.presets.cupti.class)
public class CUpti_ActivityBranch2 extends Pointer {
static { Loader.load(); }
/** Default native constructor. */
public CUpti_ActivityBranch2() { super((Pointer)null); allocate(); }
/** Native array allocator. Access with {@link Pointer#position(long)}. */
public CUpti_ActivityBranch2(long size) { super((Pointer)null); allocateArray(size); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public CUpti_ActivityBranch2(Pointer p) { super(p); }
private native void allocate();
private native void allocateArray(long size);
@Override public CUpti_ActivityBranch2 position(long position) {
return (CUpti_ActivityBranch2)super.position(position);
}
@Override public CUpti_ActivityBranch2 getPointer(long i) {
return new CUpti_ActivityBranch2((Pointer)this).offsetAddress(i);
}

/**
* The activity record kind, must be CUPTI_ACTIVITY_KIND_BRANCH.
*/
public native @Cast("CUpti_ActivityKind") int kind(); public native CUpti_ActivityBranch2 kind(int setter);

/**
* The ID for source locator.
*/
public native @Cast("uint32_t") int sourceLocatorId(); public native CUpti_ActivityBranch2 sourceLocatorId(int setter);

/**
* The correlation ID of the kernel to which this result is associated.
*/
public native @Cast("uint32_t") int correlationId(); public native CUpti_ActivityBranch2 correlationId(int setter);

/**
* Correlation ID with global/device function name
*/
public native @Cast("uint32_t") int functionId(); public native CUpti_ActivityBranch2 functionId(int setter);

/**
* The pc offset for the branch.
*/
public native @Cast("uint32_t") int pcOffset(); public native CUpti_ActivityBranch2 pcOffset(int setter);

/**
* Number of times this branch diverged
*/
public native @Cast("uint32_t") int diverged(); public native CUpti_ActivityBranch2 diverged(int setter);

/**
* This increments each time when this instruction is executed by number
* of threads that executed this instruction
*/
public native @Cast("uint64_t") long threadsExecuted(); public native CUpti_ActivityBranch2 threadsExecuted(long setter);

/**
* The number of times this instruction was executed per warp. It will be incremented
* regardless of predicate or condition code.
*/
public native @Cast("uint32_t") int executed(); public native CUpti_ActivityBranch2 executed(int setter);

/**
* Undefined. Reserved for internal use.
*/
public native @Cast("uint32_t") int pad(); public native CUpti_ActivityBranch2 pad(int setter);
}
Loading