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 3 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
54 changes: 54 additions & 0 deletions cuda/src/main/java/org/bytedeco/cuda/presets/cupti.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright (C) 2015-2022 Samuel Audet
*
* Licensed either under the Apache License, Version 2.0, or (at your option)
* under the terms of the GNU General Public License as published by
* the Free Software Foundation (subject to the "Classpath" exception),
* either version 2, or any later version (collectively, the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.gnu.org/licenses/
* http://www.gnu.org/software/classpath/license.html
*
* or as provided in the LICENSE.txt file that accompanied this code.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.bytedeco.cuda.presets;

import org.bytedeco.javacpp.annotation.NoException;
import org.bytedeco.javacpp.annotation.Platform;
import org.bytedeco.javacpp.annotation.Properties;
import org.bytedeco.javacpp.tools.Info;
import org.bytedeco.javacpp.tools.InfoMap;
import org.bytedeco.javacpp.tools.InfoMapper;

/**
*
* @author Samuel Audet
HGuillemet marked this conversation as resolved.
Show resolved Hide resolved
*/
@Properties(inherit = {cudart.class}, value = {
@Platform(include = {"cupti_result.h", "cupti_version.h", "cupti_activity.h", "cupti_callbacks.h", "cupti_events.h", "cupti_metrics.h", "cupti_driver_cbid.h", "cupti_runtime_cbid.h", "cupti_nvtx_cbid.h"},
link = "cupti@.12"),
@Platform(value = "windows-x86_64", includepath = "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/extras/CUPTI/include/", linkpath = "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/extras/CUPTI/lib64/"),
HGuillemet marked this conversation as resolved.
Show resolved Hide resolved
@Platform(value = {"linux-x86_64", "linux-arm64", "linux-ppc64le"}, includepath = {"/usr/local/cuda-12.6/extras/CUPTI/include/", "/usr/local/cuda/extras/CUPTI/include/"}, linkpath = {"/usr/local/cuda-12.6/extras/CUPTI/lib64/", "/usr/local/cuda/extras/CUPTI/lib64/"}),
@Platform(value = "macosx-x86_64", includepath = "/Developer/NVIDIA/CUDA-12.6/extras/CUPTI/include/", linkpath = "/Developer/NVIDIA/CUDA-12.6/extras/CUPTI/lib64/"),
},
target = "org.bytedeco.cuda.cupti", global = "org.bytedeco.cuda.global.cupti")
@NoException
public class cupti implements InfoMapper {
public void map(InfoMap infoMap) {
infoMap
.put(new Info("CUPTIAPI").cppTypes().annotations().cppText(""))
.put(new Info("CUPTILP64").define())
.put(new Info("CUpti_EventID", "CUpti_EventDomainID", "CUpti_MetricID", "CUpti_CallbackId", "CUpti_DeviceAttribute", "CUpti_MetricValueKind").valueTypes("int").cast().pointerTypes("IntPointer", "int[]")) // enum or uint32
.put(new Info("CUpti_SubscriberHandle").valueTypes("@ByPtr CUpti_Subscriber_st").pointerTypes("@ByPtrPtr CUpti_Subscriber_st"))
;
}
}
1 change: 1 addition & 0 deletions cuda/src/main/java9/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
exports org.bytedeco.cuda.cudart;
exports org.bytedeco.cuda.cudnn;
exports org.bytedeco.cuda.cufftw;
exports org.bytedeco.cuda.cupti;
exports org.bytedeco.cuda.curand;
exports org.bytedeco.cuda.cusolver;
exports org.bytedeco.cuda.cusparse;
Expand Down