Skip to content
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
11 changes: 0 additions & 11 deletions include/acl_command_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,6 @@ void acl_delete_command_queue(cl_command_queue command_queue);
} /* extern "C" */
#endif

/**
* Tries to fast-kernel-launch a dependent event. This can only happen under a
* set of conditions:
* * The parent is a submitted kernel
* * The dependent is the same kernel as the provided parent
* * The dependent's only unresolved dependency is the parent
* @param parent The event who's dependent are being assesed for fast-kernel-
* launch eligibility
*/
void acl_try_FastKernelRelaunch_ooo_queue_event_dependents(cl_event parent);

#ifdef __GNUC__
#pragma GCC visibility pop
#endif
Expand Down
3 changes: 0 additions & 3 deletions include/acl_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@ void acl_signal_device_update();

static inline int acl_is_locked() { return (acl_global_lock_count > 0); }

// Used by dynamically loaded libs to check lock status.
int acl_is_locked_callback(void);

static inline void acl_assert_locked() { assert(acl_is_locked()); }

static inline void acl_assert_locked_or_sig() {
Expand Down
10 changes: 7 additions & 3 deletions src/acl_command_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,9 +630,13 @@ int acl_update_queue(cl_command_queue command_queue) {
}
}

// Try to submit a kernel even if it has unfinished dependences using fast
// kernel relaunch
// Returns true on success, false on failure
/**
* Tries to fast relaunch a kernel event
* @param event is the kernel event to be launched, where its only parent
* event is a kernel event that tracks previous launch of the same kernel
* and is submitted, running, or completed
* @return true if the fast-kernel-launch succeeded, else false
*/
bool acl_fast_relaunch_kernel(cl_event event) {
if (!(event->command_queue->properties &
CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE))
Expand Down
85 changes: 28 additions & 57 deletions src/acl_device_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,67 +107,38 @@ static int l_is_mem_in_use(acl_device_op_t *op, acl_device_op_queue_t *doq);

static unsigned char conflict_matrix_half_duplex
[ACL_NUM_CONFLICT_TYPES][ACL_NUM_CONFLICT_TYPES] = {

// NONE, MEM_READ, MEM_WRITE, MEM_RW, KERNEL,
// PROGRAM, HOSTPIPE_READ, HOSTPIPE_WRITE,
// DEVICE_GLOBAL_READ, DEVICE_GLOBAL_WRITE
// NONE vs.
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0}
// MEM_READ vs.
,
{0, 1, 1, 1, 0, 1, 1, 1, 1, 1}
// MEM_WRITE vs.
,
{0, 1, 1, 1, 0, 1, 1, 1, 1, 1}
// MEM_RW vs.
,
{0, 1, 1, 1, 0, 1, 1, 1, 1, 1}
// KERNEL vs.
,
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0}
// PROGRAM vs.
,
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
// HOSTPIPE_READ vs.
{0, 1, 1, 1, 0, 1, 0, 0, 1, 1},
// HOSTPIPE_WRITE vs.
{0, 1, 1, 1, 0, 1, 0, 0, 1, 1},
// DEVICE_GLOBAL_READ vs.
{0, 1, 1, 1, 0, 1, 1, 1, 1, 1},
// DEVICE_GLOBAL_WRITE vs.
{0, 1, 1, 1, 0, 1, 1, 1, 1, 1}};
// NONE, MEM_READ, MEM_WRITE, MEM_RW, KERNEL,
// PROGRAM, HOSTPIPE_READ, HOSTPIPE_WRITE,
// DEVICE_GLOBAL_READ, DEVICE_GLOBAL_WRITE
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0}, // vs. None
{0, 1, 1, 1, 0, 1, 1, 1, 1, 1}, // vs. MEM_READ
{0, 1, 1, 1, 0, 1, 1, 1, 1, 1}, // vs. MEM_WRITE
{0, 1, 1, 1, 0, 1, 1, 1, 1, 1}, // vs. MEM_RW
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0}, // vs. KERNEL
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // vs. PROGRAM
{0, 1, 1, 1, 0, 1, 0, 0, 1, 1}, // vs. HOSTPIPE_READ
{0, 1, 1, 1, 0, 1, 0, 0, 1, 1}, // vs. HOSTPIPE_WRITE
{0, 1, 1, 1, 0, 1, 1, 1, 1, 1}, // vs. DEVICE_GLOBAL_READ
{0, 1, 1, 1, 0, 1, 1, 1, 1, 1} // vs. DEVICE_GLOBAL_WRITE
};

static unsigned char conflict_matrix_full_duplex
[ACL_NUM_CONFLICT_TYPES][ACL_NUM_CONFLICT_TYPES] = {

// NONE, MEM_READ, MEM_WRITE, MEM_RW, KERNEL,
// PROGRAM, HOSTPIPE_READ, HOSTPIPE_WRITE
// DEVICE_GLOBAL_READ, DEVICE_GLOBAL_WRITE
// NONE vs.
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0}
// MEM_READ vs.
,
{0, 1, 0, 1, 0, 1, 1, 1, 1, 0}
// MEM_WRITE vs.
,
{0, 0, 1, 1, 0, 1, 1, 1, 0, 1}
// MEM_RW vs.
,
{0, 1, 1, 1, 0, 1, 1, 1, 1, 1}
// KERNEL vs.
,
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0}
// PROGRAM vs.
,
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
// HOSTPIPE_READ vs.
{0, 1, 1, 1, 0, 1, 0, 0, 0, 0},
// HOSTPIPE_WRITE vs.
{0, 1, 1, 1, 0, 1, 0, 0, 0, 0},
// DEVICE_GLOBAL_READ vs.
{0, 1, 0, 1, 0, 1, 1, 1, 1, 0},
// DEVICE_GLOBAL_WRITE vs.
{0, 0, 1, 1, 0, 1, 1, 1, 0, 1}};
// NONE, MEM_READ, MEM_WRITE, MEM_RW, KERNEL,
// PROGRAM, HOSTPIPE_READ, HOSTPIPE_WRITE
// DEVICE_GLOBAL_READ, DEVICE_GLOBAL_WRITE
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0}, // vs. None
{0, 1, 0, 1, 0, 1, 1, 1, 1, 0}, // vs. MEM_READ
{0, 0, 1, 1, 0, 1, 1, 1, 0, 1}, // vs. MEM_WRITE
{0, 1, 1, 1, 0, 1, 1, 1, 1, 1}, // vs. MEM_RW
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0}, // vs. KERNEL
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // vs. PROGRAM
{0, 1, 1, 1, 0, 1, 0, 0, 0, 0}, // vs. HOSTPIPE_READ
{0, 1, 1, 1, 0, 1, 0, 0, 0, 0}, // vs. HOSTPIPE_WRITE
{0, 1, 0, 1, 0, 1, 1, 1, 1, 0}, // vs. DEVICE_GLOBAL_READ
{0, 0, 1, 1, 0, 1, 1, 1, 0, 1} // vs. DEVICE_GLOBAL_WRITE
};

static const char *l_type_name(int op_type) {
switch (op_type) {
Expand Down
5 changes: 0 additions & 5 deletions src/acl_hal_mmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1374,9 +1374,6 @@ static int src_dev_done;
static int dst_dev_done;
static void l_dev_to_dev_copy_handler(int handle, void *user_data,
aocl_mmd_op_t op, int status) {
acl_sig_started();
// NOTE: all exit points of this function must first call acl_sig_finished()

// Removing Windows warning
user_data = user_data;
handle = handle;
Expand All @@ -1387,8 +1384,6 @@ static void l_dev_to_dev_copy_handler(int handle, void *user_data,
dst_dev_done = 1;
} else
assert(0 && "dev_to_dev_copy got unexpected event");

acl_sig_finished();
}

// **************************************************************************
Expand Down
18 changes: 0 additions & 18 deletions src/acl_kernel_if.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ acl_process_autorun_profiler_scan_chain(unsigned int physical_device_id,
k->io.printf((m), ##__VA_ARGS__); \
} while (0)

//#define POLLING
//#define POLLING_PERIOD (10000) // polling period in ns

typedef time_ns time_us;

// Function declarations
Expand Down Expand Up @@ -1489,11 +1486,7 @@ static void acl_kernel_if_update_status_finish(acl_kernel_if *kern,
void acl_kernel_if_update_status(acl_kernel_if *kern) {
acl_assert_locked_or_sig();

#ifdef POLLING
ACL_KERNEL_IF_DEBUG_MSG_VERBOSE(kern, 10, ":: Updating kernel status.\n");
#else
ACL_KERNEL_IF_DEBUG_MSG_VERBOSE(kern, 5, ":: Updating kernel status.\n");
#endif

// Check which accelerators are done and update their status appropriately
for (unsigned int accel_id = 0; accel_id < kern->num_accel; ++accel_id) {
Expand Down Expand Up @@ -1674,9 +1667,6 @@ void acl_kernel_if_dump_status(acl_kernel_if *kern) {
// Called by the host program when there are spare cycles or
// if the host has been waiting for a while in debug mode.
void acl_kernel_if_check_kernel_status(acl_kernel_if *kern) {
#ifdef POLLING
static time_ns last_update;
#endif
acl_assert_locked();

if (kern->last_kern_update != 0 &&
Expand All @@ -1698,14 +1688,6 @@ void acl_kernel_if_check_kernel_status(acl_kernel_if *kern) {
acl_kernel_if_dump_status(kern);
}
}

#ifdef POLLING
time_ns time = kern->io.get_time_ns();
if (time > last_update + POLLING_PERIOD || time < last_update) {
last_update = time;
acl_kernel_if_update_status(kern);
}
#endif
}

// Called when a printf buffer processing is done for kernel, and
Expand Down
2 changes: 0 additions & 2 deletions src/acl_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ void acl_mutex_wrapper_t::unlock() {
}
}

int acl_is_locked_callback(void) { return (acl_global_lock_count > 0); }

int acl_mutex_wrapper_t::suspend_lock() {
int old_lock_count = acl_global_lock_count;
acl_global_lock_count = 0;
Expand Down