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

[API] New API call in the Execution Plan to log/trace the plan #565

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* Copyright (c) 2024, APT Group, Department of Computer Science,
* The University of Manchester.
*
* Licensed under the Apache License, Version 2.0 (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
*
* 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 uk.ac.manchester.tornado.api;

import uk.ac.manchester.tornado.api.plan.types.OffConcurrentDevices;
import uk.ac.manchester.tornado.api.plan.types.OffMemoryLimit;
import uk.ac.manchester.tornado.api.plan.types.OffPrintKernel;
import uk.ac.manchester.tornado.api.plan.types.OffProfiler;
import uk.ac.manchester.tornado.api.plan.types.OffThreadInfo;
import uk.ac.manchester.tornado.api.plan.types.WithBatch;
import uk.ac.manchester.tornado.api.plan.types.WithClearProfiles;
import uk.ac.manchester.tornado.api.plan.types.WithCompilerFlags;
import uk.ac.manchester.tornado.api.plan.types.WithConcurrentDevices;
import uk.ac.manchester.tornado.api.plan.types.WithDefaultScheduler;
import uk.ac.manchester.tornado.api.plan.types.WithDevicePlan;
import uk.ac.manchester.tornado.api.plan.types.WithDynamicReconfiguration;
import uk.ac.manchester.tornado.api.plan.types.WithFreeDeviceMemory;
import uk.ac.manchester.tornado.api.plan.types.WithGridScheduler;
import uk.ac.manchester.tornado.api.plan.types.WithMemoryLimit;
import uk.ac.manchester.tornado.api.plan.types.WithPrintKernel;
import uk.ac.manchester.tornado.api.plan.types.WithProfiler;
import uk.ac.manchester.tornado.api.plan.types.WithResetDevice;
import uk.ac.manchester.tornado.api.plan.types.WithThreadInfo;
import uk.ac.manchester.tornado.api.plan.types.WithWarmUp;

public abstract sealed class ExecutionPlanType extends TornadoExecutionPlan //
permits OffConcurrentDevices, OffMemoryLimit, OffPrintKernel, //
OffProfiler, OffThreadInfo, WithWarmUp, WithBatch, WithClearProfiles, //
WithCompilerFlags, WithConcurrentDevices, WithDefaultScheduler, //
WithDevicePlan, WithDynamicReconfiguration, WithFreeDeviceMemory, //
WithGridScheduler, WithMemoryLimit, WithPrintKernel, WithProfiler, //
WithResetDevice, WithThreadInfo {

public ExecutionPlanType(TornadoExecutionPlan parentNode) {

// Set link between the previous action (parent) and the new one
this.parentLink = parentNode;

// Propagate the root node of the current execution plan
this.rootNode = parentNode.rootNode;

// Set Link the root node to the leaf
this.rootNode.childLink = this;

// Copy the reference for the executor
this.tornadoExecutor = parentNode.tornadoExecutor;

// Copy the reference for the execution frame
this.executionFrame = parentNode.executionFrame;

// Set child reference to this instance
this.childLink = this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* affecting the execution of graphs encapsulated in {@link ImmutableTaskGraph}.
* </p>
*
* @since TornadoVM-0.15
* @since 0.15
*/
public class ImmutableTaskGraph {

Expand Down Expand Up @@ -170,10 +170,6 @@ void enableProfiler(ProfilerMode profilerMode) {
taskGraph.enableProfiler(profilerMode);
}

void disableProfiler(ProfilerMode profilerMode) {
stratika marked this conversation as resolved.
Show resolved Hide resolved
taskGraph.disableProfiler(profilerMode);
}

void withConcurrentDevices() {
taskGraph.withConcurrentDevices();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -862,10 +862,6 @@ void enableProfiler(ProfilerMode profilerMode) {
taskGraphImpl.enableProfiler(profilerMode);
}

void disableProfiler(ProfilerMode profilerMode) {
taskGraphImpl.disableProfiler(profilerMode);
}

void withConcurrentDevices() {
taskGraphImpl.withConcurrentDevices();
}
Expand Down
Loading