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
95 changes: 95 additions & 0 deletions lib/node_modules/@stdlib/blas/ext/base/dleft-pad-edge/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,39 @@
# Target name should match the add-on export name:
'addon_target_name%': 'addon',

# Fortran compiler (to override -Dfortran_compiler=<compiler>):
'fortran_compiler%': 'gfortran',

# Fortran compiler flags:
'fflags': [
# Specify the Fortran standard to which a program is expected to conform:
'-std=f95',

# Indicate that the layout is free-form source code:
'-ffree-form',

# Aggressive optimization:
'-O3',

# Enable commonly used warning options:
'-Wall',

# Warn if source code contains problematic language features:
'-Wextra',

# Warn if a procedure is called without an explicit interface:
'-Wimplicit-interface',

# Do not transform names of entities specified in Fortran source files by appending underscores (i.e., don't mangle names, thus allowing easier usage in C wrappers):
'-fno-underscoring',

# Warn if source code contains Fortran 95 extensions and C-language constructs:
'-pedantic',

# Compile but do not link (output is an object file):
'-c',
],

# Set variables based on the host OS:
'conditions': [
[
Expand Down Expand Up @@ -128,6 +161,68 @@
},
], # end condition (OS!="win")
], # end conditions

# Define custom build actions for particular inputs:
'rules': [
{
# Define a rule for processing Fortran files:
'extension': 'f',

# Define the pathnames to be used as inputs when performing processing:
'inputs': [
# Full path of the current input:
'<(RULE_INPUT_PATH)'
],

# Define the outputs produced during processing:
'outputs': [
# Store an output object file in a directory for placing intermediate results (only accessible within a single target):
'<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).<(obj)'
],

# Define the rule for compiling Fortran based on the host OS:
'conditions': [
[
'OS=="win"',

# Rule to compile Fortran on Windows:
{
'rule_name': 'compile_fortran_windows',
'message': 'Compiling Fortran file <(RULE_INPUT_PATH) on Windows...',

'process_outputs_as_sources': 0,

# Define the command-line invocation:
'action': [
'<(fortran_compiler)',
'<@(fflags)',
'<@(_inputs)',
'-o',
'<@(_outputs)',
],
},

# Rule to compile Fortran on non-Windows:
{
'rule_name': 'compile_fortran_linux',
'message': 'Compiling Fortran file <(RULE_INPUT_PATH) on Linux...',

'process_outputs_as_sources': 1,

# Define the command-line invocation:
'action': [
'<(fortran_compiler)',
'<@(fflags)',
'-fPIC', # generate platform-independent code
'<@(_inputs)',
'-o',
'<@(_outputs)',
],
}
], # end condition (OS=="win")
], # end conditions
}, # end rule (extension=="f")
], # end rules
}, # end target <(addon_target_name)

# Target to copy a generated add-on to a standard location:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@

'use strict';

// MODULES //

var dcopy = require( '@stdlib/blas/base/dcopy' ).ndarray;
var dfill = require( '@stdlib/blas/ext/base/dfill' ).ndarray;


// MAIN //

/**
Expand All @@ -43,29 +49,14 @@
* // y => <Float64Array>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 3.0, 4.0 ]
*/
function dleftPadEdge( N, k, x, strideX, offsetX, y, strideY, offsetY ) {
var ix;
var iy;
var v;
var i;

if ( N <= 0 ) {
return y;
}
if ( k < 0 ) {
k = 0;
}
v = x[ offsetX ];
iy = offsetY;
for ( i = 0; i < k; i++ ) {
y[ iy ] = v;
iy += strideY;
}
ix = offsetX;
for ( i = 0; i < N; i++ ) {
y[ iy ] = x[ ix ];
iy += strideY;
ix += strideX;
}
dfill( k, x[ offsetX ], y, strideY, offsetY );
dcopy( N, x, strideX, offsetX, y, strideY, offsetY + ( strideY * k ) );
return y;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"options": {
"task": "build"
"task": "build",
"wasm": false
},
"fields": [
{
Expand All @@ -27,6 +28,7 @@
"confs": [
{
"task": "build",
"wasm": false,
"src": [
"./src/main.c"
],
Expand All @@ -36,16 +38,19 @@
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/blas/base/shared",
"@stdlib/blas/base/dcopy",
"@stdlib/blas/ext/base/dfill",
"@stdlib/strided/base/stride2offset",
"@stdlib/napi/export",
"@stdlib/napi/argv",
"@stdlib/napi/argv-int64",
"@stdlib/napi/argv-strided-float64array",
"@stdlib/strided/base/stride2offset",
"@stdlib/blas/base/shared"
"@stdlib/napi/argv-strided-float64array"
]
},
{
"task": "benchmark",
"wasm": false,
"src": [
"./src/main.c"
],
Expand All @@ -55,12 +60,15 @@
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/strided/base/stride2offset",
"@stdlib/blas/base/shared"
"@stdlib/blas/base/shared",
"@stdlib/blas/base/dcopy",
"@stdlib/blas/ext/base/dfill",
"@stdlib/strided/base/stride2offset"
]
},
{
"task": "examples",
"wasm": false,
"src": [
"./src/main.c"
],
Expand All @@ -70,8 +78,28 @@
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/strided/base/stride2offset",
"@stdlib/blas/base/shared"
"@stdlib/blas/base/shared",
"@stdlib/blas/base/dcopy",
"@stdlib/blas/ext/base/dfill",
"@stdlib/strided/base/stride2offset"
]
},
{
"task": "build",
"wasm": true,
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/blas/base/shared",
"@stdlib/blas/base/dcopy",
"@stdlib/blas/ext/base/dfill",
"@stdlib/strided/base/stride2offset"
]
}
]
Expand Down
21 changes: 4 additions & 17 deletions lib/node_modules/@stdlib/blas/ext/base/dleft-pad-edge/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*/

#include "stdlib/blas/ext/base/dleft_pad_edge.h"
#include "stdlib/blas/ext/base/dfill.h"
#include "stdlib/blas/base/dcopy.h"
#include "stdlib/strided/base/stride2offset.h"
#include "stdlib/blas/base/shared.h"

Expand Down Expand Up @@ -55,27 +57,12 @@ void API_SUFFIX(stdlib_strided_dleft_pad_edge)( const CBLAS_INT N, CBLAS_INT k,
* @param offsetY starting index for `Y`
*/
void API_SUFFIX(stdlib_strided_dleft_pad_edge_ndarray)( const CBLAS_INT N, CBLAS_INT k, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, double *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY ) {
CBLAS_INT ix;
CBLAS_INT iy;
double v;
CBLAS_INT i;

if ( N <= 0 ) {
return;
}
if ( k < 0 ) {
k = 0;
}
v = X[ offsetX ];
iy = offsetY;
for ( i = 0; i < k; i++ ) {
Y[ iy ] = v;
iy += strideY;
}
ix = offsetX;
for ( i = 0; i < N; i++ ) {
Y[ iy ] = X[ ix ];
iy += strideY;
ix += strideX;
}
API_SUFFIX(stdlib_strided_dfill_ndarray)( k, X[ offsetX ], Y, strideY, offsetY );
API_SUFFIX(c_dcopy_ndarray)( N, X, strideX, offsetX, Y, strideY, offsetY + ( strideY * k ) );
}
Loading