-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
28 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
import cython | ||
|
||
# @cython.boundscheck(False) | ||
def subtract_exclusive_metric_vals(long nid, long parent_nid, double[:] metrics, long num_stmt_nodes, long stride): | ||
cdef long ref_nid = nid | ||
cdef long ref_pnid = parent_nid | ||
|
||
# compiler directive | ||
with cython.boundscheck(False): | ||
# we are modifying metrics in place here | ||
# since they are passed by refrence via their | ||
# memory | ||
for i in range(num_stmt_nodes): | ||
metrics[ref_pnid-1] -= metrics[ref_nid-1] | ||
|
||
ref_nid += stride | ||
ref_pnid += stride | ||
# Copyright 2017-2020 Lawrence Livermore National Security, LLC and other | ||
# Hatchet Project Developers. See the top-level LICENSE file for details. | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
import cython | ||
|
||
# @cython.boundscheck(False) | ||
def subtract_exclusive_metric_vals(long nid, long parent_nid, double[:] metrics, long num_stmt_nodes, long stride): | ||
cdef long ref_nid = nid | ||
cdef long ref_pnid = parent_nid | ||
|
||
# compiler directive | ||
with cython.boundscheck(False): | ||
# we are modifying metrics in place here | ||
# since they are passed by refrence via their | ||
# memory | ||
for i in range(num_stmt_nodes): | ||
metrics[ref_pnid-1] -= metrics[ref_nid-1] | ||
|
||
ref_nid += stride | ||
ref_pnid += stride |