Disabled external gits
This commit is contained in:
48
cs440-acg/ext/tbb/examples/graph/cholesky/Makefile.windows
Normal file
48
cs440-acg/ext/tbb/examples/graph/cholesky/Makefile.windows
Normal file
@@ -0,0 +1,48 @@
|
||||
# Copyright (c) 2005-2020 Intel Corporation
|
||||
#
|
||||
# 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.
|
||||
|
||||
# Common Makefile that builds and runs example.
|
||||
|
||||
# Just specify your program basename
|
||||
PROG=Cholesky
|
||||
ARGS=4 2
|
||||
|
||||
# Trying to find if icl.exe is set
|
||||
CXX1 = $(TBB_CXX)-
|
||||
CXX2 = $(CXX1:icl.exe-=icl.exe)
|
||||
CXX = $(CXX2:-=cl.exe)
|
||||
|
||||
# The C++ compiler options
|
||||
MYCXXFLAGS = /TP /EHsc /W3 /nologo /D _CONSOLE /D _MBCS /D WIN32 /D _WIN32_WINNT=0x0501 $(CXXFLAGS)
|
||||
MYLDFLAGS = /INCREMENTAL:NO /NOLOGO /DEBUG /FIXED:NO $(LDFLAGS)
|
||||
|
||||
# MKL support
|
||||
MKL_LIBS1 = $(TBB_TARGET_ARCH)
|
||||
MKL_LIBS2 = $(MKL_LIBS1:ia32=mkl_core.lib mkl_sequential.lib mkl_intel_c.lib)
|
||||
MKL_LIBS = $(MKL_LIBS2:intel64=mkl_core.lib mkl_sequential.lib mkl_intel_lp64.lib)
|
||||
|
||||
all: release test
|
||||
release: compiler_check
|
||||
$(CXX) *.cpp /MD /O2 /D NDEBUG $(MYCXXFLAGS) /link tbb.lib $(MKL_LIBS) $(LIBS) $(MYLDFLAGS) /OUT:$(PROG).exe
|
||||
debug: compiler_check
|
||||
$(CXX) *.cpp /MDd /Od /Zi /D TBB_USE_DEBUG /D _DEBUG $(MYCXXFLAGS) /link tbb_debug.lib $(MKL_LIBS) $(LIBS) $(MYLDFLAGS) /OUT:$(PROG).exe
|
||||
profile: compiler_check
|
||||
$(CXX) *.cpp /MD /O2 /Zi /D NDEBUG $(MYCXXFLAGS) /D TBB_USE_THREADING_TOOLS /link tbb.lib $(MKL_LIBS) $(LIBS) $(MYLDFLAGS) /OUT:$(PROG).exe
|
||||
clean:
|
||||
@cmd.exe /C del $(PROG).exe *.obj *.?db *.manifest
|
||||
test:
|
||||
$(PROG) $(ARGS)
|
||||
compiler_check:
|
||||
@echo compiler_test>compiler_test && @$(CXX) /E compiler_test >nul 2>&1 || echo "$(CXX) command not found. Check if CXX=$(CXX) is set properly"
|
||||
@cmd.exe /C del compiler_test
|
713
cs440-acg/ext/tbb/examples/graph/cholesky/cholesky.cpp
Normal file
713
cs440-acg/ext/tbb/examples/graph/cholesky/cholesky.cpp
Normal file
@@ -0,0 +1,713 @@
|
||||
/*
|
||||
Copyright (c) 2005-2020 Intel Corporation
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
#include <cstdio>
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#include "mkl_lapack.h"
|
||||
#include "mkl.h"
|
||||
|
||||
#include "tbb/tbb_config.h"
|
||||
#include "tbb/flow_graph.h"
|
||||
#include "tbb/tick_count.h"
|
||||
#include "tbb/global_control.h"
|
||||
|
||||
// Application command line arguments parsing
|
||||
#include "../../common/utility/utility.h"
|
||||
#include "../../common/utility/get_default_num_threads.h"
|
||||
|
||||
/************************************************************
|
||||
FORWARD DECLARATIONS
|
||||
************************************************************/
|
||||
|
||||
/**********************************************
|
||||
Read or generate a positive-definite matrix
|
||||
-- reads from file if fname != NULL
|
||||
-- sets n to matrix size
|
||||
-- allocates and reads values in to A
|
||||
-- otherwise generates a matrix
|
||||
-- uses n to determine size
|
||||
-- allocates and generates values in to A
|
||||
**********************************************/
|
||||
void matrix_init( double * &A, int &n, const char *fname );
|
||||
|
||||
/**********************************************
|
||||
Writes a lower triangular matrix to a file
|
||||
-- first line of file is n
|
||||
-- subsequently 1 row per line
|
||||
**********************************************/
|
||||
void matrix_write ( double *A, int n, const char *fname, bool is_triangular = false );
|
||||
|
||||
/************************************************************
|
||||
GLOBAL VARIABLES
|
||||
************************************************************/
|
||||
bool g_benchmark_run = false;
|
||||
int g_n = -1, g_b = -1, g_num_trials = 1;
|
||||
char *g_input_file_name = NULL;
|
||||
char *g_output_prefix = NULL;
|
||||
std::string g_alg_name;
|
||||
int g_num_tbb_threads;
|
||||
|
||||
// Creates tiled array
|
||||
static double ***create_tile_array( double *A, int n, int b ) {
|
||||
const int p = n/b;
|
||||
double ***tile = (double ***)calloc( sizeof( double ** ), p );
|
||||
|
||||
for ( int j = 0; j < p; ++j ) {
|
||||
tile[j] = (double **)calloc( sizeof( double * ), p );
|
||||
}
|
||||
|
||||
for ( int j = 0; j < p; ++j ) {
|
||||
for ( int i = 0; i < p; ++i ) {
|
||||
double *temp_block = (double *)calloc( sizeof( double ), b*b );
|
||||
|
||||
for ( int A_j = j*b, T_j = 0; T_j < b; ++A_j, ++T_j ) {
|
||||
for ( int A_i = i*b, T_i = 0; T_i < b; ++A_i, ++T_i ) {
|
||||
temp_block[T_j*b+T_i] = A[A_j*n+A_i];
|
||||
}
|
||||
}
|
||||
|
||||
tile[j][i] = temp_block;
|
||||
}
|
||||
}
|
||||
return tile;
|
||||
}
|
||||
|
||||
static void collapse_tile_array( double ***tile, double *A, int n, int b ) {
|
||||
const int p = n/b;
|
||||
|
||||
for ( int j = 0; j < p; ++j ) {
|
||||
for ( int i = 0; i < p; ++i ) {
|
||||
double *temp_block = tile[j][i];
|
||||
|
||||
for ( int A_j = j*b, T_j = 0; T_j < b; ++A_j, ++T_j ) {
|
||||
for ( int A_i = i*b, T_i = 0; T_i < b; ++A_i, ++T_i ) {
|
||||
A[A_j*n+A_i] = temp_block[T_j*b+T_i];
|
||||
}
|
||||
}
|
||||
|
||||
free( temp_block );
|
||||
tile[j][i] = NULL;
|
||||
}
|
||||
|
||||
free( tile[j] );
|
||||
}
|
||||
|
||||
free( tile );
|
||||
}
|
||||
|
||||
/************************************************************
|
||||
Helper base class: algorithm
|
||||
************************************************************/
|
||||
class algorithm {
|
||||
|
||||
std::string name;
|
||||
bool is_tiled;
|
||||
|
||||
bool check_if_valid( double *A0, double *C, double *A, int n ) {
|
||||
char transa = 'n', transb = 't';
|
||||
double alpha = 1;
|
||||
double beta = 0;
|
||||
|
||||
for ( int i = 0; i < n; ++i ) {
|
||||
for ( int j = i+1; j < n; ++j ) {
|
||||
A0[j*n+i] = 0.;
|
||||
}
|
||||
}
|
||||
|
||||
dgemm ( &transa, &transb, &n, &n, &n, &alpha, A0, &n, A0, &n, &beta, C, &n );
|
||||
|
||||
for ( int j = 0; j < n; ++j ) {
|
||||
for ( int i = 0; i < n; ++i ) {
|
||||
const double epsilon = std::abs( A[j*n+i]*0.1 );
|
||||
|
||||
if ( std::abs( C[j*n+i] - A[j*n+i] ) > epsilon ) {
|
||||
printf( "ERROR: %s did not validate at C(%d,%d) = %lf != A(%d,%d) = %lf\n",
|
||||
name.c_str(), i, j, C[j*n+i], i, j, A[j*n+i] );
|
||||
printf( "ERROR: %g; %g < %g < %g\n", epsilon, A[j*n+i] - epsilon, C[j*n+i], A[j*n+i] + epsilon );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public:
|
||||
algorithm( const std::string& alg_name, bool t ) : name(alg_name), is_tiled(t) {}
|
||||
|
||||
double operator() ( double *A, int n, int b, int trials ) {
|
||||
tbb::tick_count t0, t1;
|
||||
double elapsed_time = 0.0;
|
||||
double *A0 = (double *)calloc( sizeof( double ), n*n );
|
||||
double *C = (double *)calloc( sizeof( double ), n*n );
|
||||
|
||||
for ( int t = 0; t < trials+1; ++t ) {
|
||||
if ( is_tiled ) {
|
||||
double ***tile = create_tile_array( A, n, b );
|
||||
t0 = tbb::tick_count::now();
|
||||
func( tile, n, b );
|
||||
t1 = tbb::tick_count::now();
|
||||
|
||||
collapse_tile_array( tile, A0, n, b );
|
||||
}
|
||||
else {
|
||||
memcpy( A0, A, sizeof( double )*n*n );
|
||||
t0 = tbb::tick_count::now();
|
||||
func( A0, n, b );
|
||||
t1 = tbb::tick_count::now();
|
||||
}
|
||||
|
||||
if ( t ) elapsed_time += (t1-t0).seconds();
|
||||
|
||||
if( !g_benchmark_run && !check_if_valid( A0, C, A, n ) ) {
|
||||
if ( g_output_prefix ) {
|
||||
std::string s( g_output_prefix );
|
||||
s += "_" + name + ".txt";
|
||||
matrix_write( A0, g_n, s.c_str(), true );
|
||||
free( A0 );
|
||||
free( C );
|
||||
return 0.;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( g_output_prefix ) {
|
||||
std::string s( g_output_prefix );
|
||||
s += "_" + name + ".txt";
|
||||
matrix_write( A0, g_n, s.c_str(), true );
|
||||
}
|
||||
|
||||
printf( "%s %d %d %d %d %lf %lf\n", name.c_str(), g_num_tbb_threads, trials, n, b, elapsed_time, elapsed_time/trials );
|
||||
free( A0 );
|
||||
free( C );
|
||||
return elapsed_time;
|
||||
}
|
||||
|
||||
protected:
|
||||
// Main algorithm body function must be defined in any direved class
|
||||
virtual void func( void * ptr, int n, int b ) = 0;
|
||||
};
|
||||
|
||||
/***********************************************************/
|
||||
|
||||
static void call_dpotf2( double ***tile, int b, int k ) {
|
||||
double *A_block = tile[k][k];
|
||||
char uplo = 'l';
|
||||
int info = 0;
|
||||
dpotf2( &uplo, &b, A_block, &b, &info );
|
||||
return;
|
||||
}
|
||||
|
||||
static void call_dtrsm( double ***tile, int b, int k, int j ) {
|
||||
double *A_block = tile[k][j];
|
||||
double *L_block = tile[k][k];
|
||||
char uplo = 'l', side = 'r', transa = 't', diag = 'n';
|
||||
double alpha = 1;
|
||||
dtrsm( &side, &uplo, &transa, &diag, &b, &b, &alpha, L_block, &b, A_block, &b );
|
||||
return;
|
||||
}
|
||||
|
||||
static void call_dsyr2k( double ***tile, int b, int k, int j, int i ) {
|
||||
double *A_block = tile[i][j];
|
||||
char transa = 'n', transb = 't';
|
||||
char uplo = 'l';
|
||||
double alpha = -1;
|
||||
double beta = 1;
|
||||
|
||||
if ( i == j ) { // Diagonal block
|
||||
double *L_block = tile[k][i];
|
||||
dsyrk( &uplo, &transa, &b, &b, &alpha, L_block, &b, &beta, A_block, &b );
|
||||
} else { // Non-diagonal block
|
||||
double *L2_block = tile[k][i];
|
||||
double *L1_block = tile[k][j];
|
||||
dgemm( &transa, &transb, &b, &b, &b, &alpha, L1_block, &b, L2_block, &b, &beta, A_block, &b );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
class algorithm_crout : public algorithm
|
||||
{
|
||||
public:
|
||||
algorithm_crout() : algorithm("crout_cholesky", true) {}
|
||||
|
||||
protected:
|
||||
virtual void func( void * ptr, int n, int b ) {
|
||||
double ***tile = (double ***)ptr;
|
||||
const int p = n/b;
|
||||
|
||||
for ( int k = 0; k < p; ++k ) {
|
||||
call_dpotf2( tile, b, k );
|
||||
|
||||
for ( int j = k+1; j < p; ++j ) {
|
||||
call_dtrsm( tile, b, k, j );
|
||||
|
||||
for ( int i = k+1; i <= j; ++i ) {
|
||||
call_dsyr2k( tile, b, k, j, i );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class algorithm_dpotrf : public algorithm
|
||||
{
|
||||
public:
|
||||
algorithm_dpotrf() : algorithm("dpotrf_cholesky", false) {}
|
||||
|
||||
protected:
|
||||
virtual void func( void * ptr, int n, int /* b */ ) {
|
||||
double *A = (double *)ptr;
|
||||
int lda = n;
|
||||
int info = 0;
|
||||
char uplo = 'l';
|
||||
dpotrf( &uplo, &n, A, &lda, &info );
|
||||
}
|
||||
};
|
||||
|
||||
/************************************************************
|
||||
Begin data join graph based version of cholesky
|
||||
************************************************************/
|
||||
|
||||
typedef union {
|
||||
char a[4];
|
||||
size_t tag;
|
||||
} tag_t;
|
||||
|
||||
typedef double * tile_t;
|
||||
|
||||
typedef std::pair< tag_t, tile_t > tagged_tile_t;
|
||||
typedef tbb::flow::tuple< tagged_tile_t > t1_t;
|
||||
typedef tbb::flow::tuple< tagged_tile_t, tagged_tile_t > t2_t;
|
||||
typedef tbb::flow::tuple< tagged_tile_t, tagged_tile_t, tagged_tile_t > t3_t;
|
||||
|
||||
typedef tbb::flow::multifunction_node< tagged_tile_t, t1_t > dpotf2_node_t;
|
||||
typedef tbb::flow::multifunction_node< t2_t, t2_t > dtrsm_node_t;
|
||||
typedef tbb::flow::multifunction_node< t3_t, t3_t > dsyr2k_node_t;
|
||||
|
||||
typedef tbb::flow::join_node< t2_t, tbb::flow::tag_matching > dtrsm_join_t;
|
||||
typedef tbb::flow::join_node< t3_t, tbb::flow::tag_matching > dsyr2k_join_t;
|
||||
|
||||
class dpotf2_body {
|
||||
int p;
|
||||
int b;
|
||||
public:
|
||||
dpotf2_body( int p_, int b_ ) : p(p_), b(b_) {}
|
||||
|
||||
void operator()( const tagged_tile_t &in, dpotf2_node_t::output_ports_type &ports ) {
|
||||
int k = in.first.a[0];
|
||||
tile_t A_block = in.second;
|
||||
tag_t t;
|
||||
t.tag = 0;
|
||||
t.a[0] = k;
|
||||
char uplo = 'l';
|
||||
int info = 0;
|
||||
dpotf2( &uplo, &b, A_block, &b, &info );
|
||||
|
||||
// Send to dtrsms in same column
|
||||
// k == k j == k
|
||||
t.a[2] = k;
|
||||
for ( int j = k+1; j < p; ++j ) {
|
||||
t.a[1] = j;
|
||||
tbb::flow::get<0>( ports ).try_put( std::make_pair( t, A_block ) );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class dtrsm_body {
|
||||
int p;
|
||||
int b;
|
||||
public:
|
||||
dtrsm_body( int p_, int b_ ) : p(p_), b(b_) {}
|
||||
|
||||
void operator()( const t2_t &in, dtrsm_node_t::output_ports_type &ports ) {
|
||||
using tbb::flow::get;
|
||||
|
||||
tagged_tile_t in0 = get<0>( in );
|
||||
tagged_tile_t in1 = get<1>( in );
|
||||
int k = in0.first.a[0];
|
||||
int j = in0.first.a[1];
|
||||
tile_t L_block = in0.second;
|
||||
tile_t A_block = in1.second;
|
||||
tag_t t;
|
||||
t.tag = 0;
|
||||
t.a[0] = k;
|
||||
char uplo = 'l', side = 'r', transa = 't', diag = 'n';
|
||||
double alpha = 1;
|
||||
dtrsm( &side, &uplo, &transa, &diag, &b, &b, &alpha, L_block, &b, A_block, &b);
|
||||
|
||||
// Send to rest of my row
|
||||
t.a[1] = j;
|
||||
for ( int i = k+1; i <= j; ++i ) {
|
||||
t.a[2] = i;
|
||||
get<0>( ports ).try_put( std::make_pair( t, A_block ) );
|
||||
}
|
||||
|
||||
// Send to transposed row
|
||||
t.a[2] = j;
|
||||
for ( int i = j; i < p; ++i ) {
|
||||
t.a[1] = i;
|
||||
get<1>( ports ).try_put( std::make_pair( t, A_block ) );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class dsyr2k_body {
|
||||
int p;
|
||||
int b;
|
||||
public:
|
||||
dsyr2k_body( int p_, int b_ ) : p(p_), b(b_) {}
|
||||
|
||||
void operator()( const t3_t &in, dsyr2k_node_t::output_ports_type &ports ) {
|
||||
using tbb::flow::get;
|
||||
|
||||
tag_t t;
|
||||
t.tag = 0;
|
||||
char transa = 'n', transb = 't';
|
||||
char uplo = 'l';
|
||||
double alpha = -1;
|
||||
double beta = 1;
|
||||
|
||||
tagged_tile_t in0 = get<0>( in );
|
||||
tagged_tile_t in1 = get<1>( in );
|
||||
tagged_tile_t in2 = get<2>( in );
|
||||
int k = in2.first.a[0];
|
||||
int j = in2.first.a[1];
|
||||
int i = in2.first.a[2];
|
||||
|
||||
tile_t A_block = in2.second;
|
||||
if ( i == j ) { // Diagonal block
|
||||
tile_t L_block = in0.second;
|
||||
dsyrk( &uplo, &transa, &b, &b, &alpha, L_block, &b, &beta, A_block, &b );
|
||||
} else { // Non-diagonal block
|
||||
tile_t L1_block = in0.second;
|
||||
tile_t L2_block = in1.second;
|
||||
dgemm( &transa, &transb, &b, &b, &b, &alpha, L1_block, &b, L2_block, &b, &beta, A_block, &b );
|
||||
}
|
||||
|
||||
// All outputs flow to next step
|
||||
t.a[0] = k+1;
|
||||
t.a[1] = j;
|
||||
t.a[2] = i;
|
||||
if ( k != p-1 && j == k+1 && i == k+1 ) {
|
||||
get<0>( ports ).try_put( std::make_pair( t, A_block ) );
|
||||
}
|
||||
|
||||
if ( k < p-2 ) {
|
||||
if ( i == k+1 && j > i ) {
|
||||
t.a[0] = k+1;
|
||||
t.a[1] = j;
|
||||
get<1>( ports ).try_put( std::make_pair( t, A_block ) );
|
||||
}
|
||||
|
||||
if ( j != k+1 && i != k+1 ) {
|
||||
t.a[0] = k+1;
|
||||
t.a[1] = j;
|
||||
t.a[2] = i;
|
||||
get<2>( ports ).try_put( std::make_pair( t, A_block ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
struct tagged_tile_to_size_t {
|
||||
size_t operator()( const tagged_tile_t &t ) {
|
||||
return t.first.tag;
|
||||
}
|
||||
};
|
||||
|
||||
class algorithm_join : public algorithm
|
||||
{
|
||||
public:
|
||||
algorithm_join() : algorithm("data_join_cholesky", true) {}
|
||||
|
||||
protected:
|
||||
virtual void func( void * ptr, int n, int b ) {
|
||||
using tbb::flow::unlimited;
|
||||
using tbb::flow::output_port;
|
||||
using tbb::flow::input_port;
|
||||
|
||||
double ***tile = (double ***)ptr;
|
||||
const int p = n/b;
|
||||
tbb::flow::graph g;
|
||||
|
||||
dpotf2_node_t dpotf2_node( g, unlimited, dpotf2_body(p, b) );
|
||||
dtrsm_node_t dtrsm_node( g, unlimited, dtrsm_body(p, b) );
|
||||
dsyr2k_node_t dsyr2k_node( g, unlimited, dsyr2k_body(p, b) );
|
||||
dtrsm_join_t dtrsm_join( g, tagged_tile_to_size_t(), tagged_tile_to_size_t() );
|
||||
dsyr2k_join_t dsyr2k_join( g, tagged_tile_to_size_t(), tagged_tile_to_size_t(), tagged_tile_to_size_t() );
|
||||
|
||||
make_edge( output_port<0>( dsyr2k_node ), dpotf2_node );
|
||||
|
||||
make_edge( output_port<0>( dpotf2_node ), input_port<0>( dtrsm_join ) );
|
||||
make_edge( output_port<1>( dsyr2k_node ), input_port<1>( dtrsm_join ) );
|
||||
make_edge( dtrsm_join, dtrsm_node );
|
||||
|
||||
make_edge( output_port<0>( dtrsm_node ), input_port<0>( dsyr2k_join ) );
|
||||
make_edge( output_port<1>( dtrsm_node ), input_port<1>( dsyr2k_join ) );
|
||||
make_edge( output_port<2>( dsyr2k_node ), input_port<2>( dsyr2k_join ) );
|
||||
make_edge( dsyr2k_join, dsyr2k_node );
|
||||
|
||||
// Now we need to send out the tiles to their first nodes
|
||||
tag_t t;
|
||||
t.tag = 0;
|
||||
t.a[0] = 0;
|
||||
t.a[1] = 0;
|
||||
t.a[2] = 0;
|
||||
|
||||
// Send to feedback input of first dpotf2
|
||||
// k == 0, j == 0, i == 0
|
||||
dpotf2_node.try_put( std::make_pair( t, tile[0][0] ) );
|
||||
|
||||
// Send to feedback input (port 1) of each dtrsm
|
||||
// k == 0, j == 1..p-1
|
||||
for ( int j = 1; j < p; ++j ) {
|
||||
t.a[1] = j;
|
||||
input_port<1>( dtrsm_join ).try_put( std::make_pair( t, tile[0][j] ) );
|
||||
}
|
||||
|
||||
// Send to feedback input (port 2) of each dsyr2k
|
||||
// k == 0
|
||||
for ( int i = 1; i < p; ++i ) {
|
||||
t.a[2] = i;
|
||||
|
||||
for ( int j = i; j < p; ++j ) {
|
||||
t.a[1] = j;
|
||||
input_port<2>( dsyr2k_join ).try_put( std::make_pair( t, tile[i][j] ) );
|
||||
}
|
||||
}
|
||||
|
||||
g.wait_for_all();
|
||||
}
|
||||
};
|
||||
|
||||
/************************************************************
|
||||
End data join graph based version of cholesky
|
||||
************************************************************/
|
||||
|
||||
/************************************************************
|
||||
Begin dependence graph based version of cholesky
|
||||
************************************************************/
|
||||
|
||||
typedef tbb::flow::continue_node< tbb::flow::continue_msg > continue_type;
|
||||
typedef continue_type * continue_ptr_type;
|
||||
|
||||
#if !__TBB_CPP11_LAMBDAS_PRESENT
|
||||
// Using helper functor classes (instead of built-in C++ 11 lambda functions)
|
||||
class call_dpotf2_functor
|
||||
{
|
||||
double ***tile;
|
||||
int b, k;
|
||||
public:
|
||||
call_dpotf2_functor( double ***tile_, int b_, int k_ )
|
||||
: tile(tile_), b(b_), k(k_) {}
|
||||
|
||||
void operator()( const tbb::flow::continue_msg & ) { call_dpotf2( tile, b, k ); }
|
||||
};
|
||||
|
||||
class call_dtrsm_functor
|
||||
{
|
||||
double ***tile;
|
||||
int b, k, j;
|
||||
public:
|
||||
call_dtrsm_functor( double ***tile_, int b_, int k_, int j_ )
|
||||
: tile(tile_), b(b_), k(k_), j(j_) {}
|
||||
|
||||
void operator()( const tbb::flow::continue_msg & ) { call_dtrsm( tile, b, k, j ); }
|
||||
};
|
||||
|
||||
class call_dsyr2k_functor
|
||||
{
|
||||
double ***tile;
|
||||
int b, k, j, i;
|
||||
public:
|
||||
call_dsyr2k_functor( double ***tile_, int b_, int k_, int j_, int i_ )
|
||||
: tile(tile_), b(b_), k(k_), j(j_), i(i_) {}
|
||||
|
||||
void operator()( const tbb::flow::continue_msg & ) { call_dsyr2k( tile, b, k, j, i ); }
|
||||
};
|
||||
|
||||
#endif // !__TBB_CPP11_LAMBDAS_PRESENT
|
||||
|
||||
class algorithm_depend : public algorithm
|
||||
{
|
||||
public:
|
||||
algorithm_depend() : algorithm("depend_cholesky", true) {}
|
||||
|
||||
protected:
|
||||
virtual void func( void * ptr, int n, int b ) {
|
||||
double ***tile = (double ***)ptr;
|
||||
|
||||
const int p = n/b;
|
||||
continue_ptr_type *c = new continue_ptr_type[p];
|
||||
continue_ptr_type **t = new continue_ptr_type *[p];
|
||||
continue_ptr_type ***u = new continue_ptr_type **[p];
|
||||
|
||||
tbb::flow::graph g;
|
||||
for ( int k = p-1; k >= 0; --k ) {
|
||||
c[k] = new continue_type( g,
|
||||
#if __TBB_CPP11_LAMBDAS_PRESENT
|
||||
[=]( const tbb::flow::continue_msg & ) { call_dpotf2( tile, b, k ); } );
|
||||
#else
|
||||
call_dpotf2_functor( tile, b, k ) );
|
||||
#endif // __TBB_CPP11_LAMBDAS_PRESENT
|
||||
t[k] = new continue_ptr_type[p];
|
||||
u[k] = new continue_ptr_type *[p];
|
||||
|
||||
for ( int j = k+1; j < p; ++j ) {
|
||||
t[k][j] = new continue_type( g,
|
||||
#if __TBB_CPP11_LAMBDAS_PRESENT
|
||||
[=]( const tbb::flow::continue_msg & ) { call_dtrsm( tile, b, k, j ); } );
|
||||
#else
|
||||
call_dtrsm_functor( tile, b, k, j ) );
|
||||
#endif // __TBB_CPP11_LAMBDAS_PRESENT
|
||||
make_edge( *c[k], *t[k][j] );
|
||||
u[k][j] = new continue_ptr_type[p];
|
||||
|
||||
for ( int i = k+1; i <= j; ++i ) {
|
||||
u[k][j][i] = new continue_type( g,
|
||||
#if __TBB_CPP11_LAMBDAS_PRESENT
|
||||
[=]( const tbb::flow::continue_msg & ) { call_dsyr2k( tile, b, k, j, i ); } );
|
||||
#else
|
||||
call_dsyr2k_functor( tile, b, k, j, i ) );
|
||||
#endif // __TBB_CPP11_LAMBDAS_PRESENT
|
||||
|
||||
if ( k < p-2 && k+1 != j && k+1 != i ) {
|
||||
make_edge( *u[k][j][i], *u[k+1][j][i] );
|
||||
}
|
||||
|
||||
make_edge( *t[k][j], *u[k][j][i] );
|
||||
|
||||
if ( i != j ) {
|
||||
make_edge( *t[k][i], *u[k][j][i] );
|
||||
}
|
||||
|
||||
if ( k < p-2 && j > i && i == k+1 ) {
|
||||
make_edge( *u[k][j][i], *t[i][j] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( k != p-1 ) {
|
||||
make_edge( *u[k][k+1][k+1], *c[k+1] );
|
||||
}
|
||||
}
|
||||
|
||||
c[0]->try_put( tbb::flow::continue_msg() );
|
||||
g.wait_for_all();
|
||||
}
|
||||
}; // class algorithm_depend
|
||||
|
||||
/************************************************************
|
||||
End dependence graph based version of cholesky
|
||||
************************************************************/
|
||||
|
||||
bool process_args( int argc, char *argv[] ) {
|
||||
utility::parse_cli_arguments( argc, argv,
|
||||
utility::cli_argument_pack()
|
||||
//"-h" option for displaying help is present implicitly
|
||||
.positional_arg( g_n, "size", "the row/column size of NxN matrix (size <= 46000)" )
|
||||
.positional_arg( g_b, "blocksize", "the block size; size must be a multiple of the blocksize" )
|
||||
.positional_arg( g_num_trials, "num_trials", "the number of times to run each algorithm" )
|
||||
.positional_arg( g_output_prefix, "output_prefix",
|
||||
"if provided the prefix will be preappended to output files:\n"
|
||||
" output_prefix_posdef.txt\n"
|
||||
" output_prefix_X.txt; where X is the algorithm used\n"
|
||||
" if output_prefix is not provided, no output will be written" )
|
||||
.positional_arg( g_alg_name, "algorithm", "name of the used algorithm - can be dpotrf, crout, depend or join" )
|
||||
.positional_arg( g_num_tbb_threads, "num_tbb_threads", "number of started TBB threads" )
|
||||
|
||||
.arg( g_input_file_name, "input_file", "if provided it will be read to get the input matrix" )
|
||||
.arg( g_benchmark_run, "-x", "skips all validation" )
|
||||
);
|
||||
|
||||
if ( g_n > 46000 ) {
|
||||
printf( "ERROR: invalid 'size' value (must be less or equal 46000): %d\n", g_n );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( g_n%g_b != 0 ) {
|
||||
printf( "ERROR: size %d must be a multiple of the blocksize %d\n", g_n, g_b );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( g_n/g_b > 256 ) {
|
||||
// Because tile index size is 1 byte only in tag_t type
|
||||
printf( "ERROR: size / blocksize must be less or equal 256, but %d / %d = %d\n", g_n, g_b, g_n/g_b );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( g_b == -1 || (g_n == -1 && g_input_file_name == NULL) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
g_num_tbb_threads = utility::get_default_num_threads();
|
||||
typedef std::map< std::string, algorithm * > algmap_t;
|
||||
algmap_t algmap;
|
||||
|
||||
// Init algorithms
|
||||
algmap.insert(std::pair<std::string, algorithm *>("dpotrf", new algorithm_dpotrf));
|
||||
algmap.insert(std::pair<std::string, algorithm *>("crout", new algorithm_crout));
|
||||
algmap.insert(std::pair<std::string, algorithm *>("depend", new algorithm_depend));
|
||||
algmap.insert(std::pair<std::string, algorithm *>("join", new algorithm_join));
|
||||
|
||||
if ( !process_args( argc, argv ) ) {
|
||||
printf( "ERROR: Invalid arguments. Run: %s -h\n", argv[0] );
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
tbb::global_control c(tbb::global_control::max_allowed_parallelism, g_num_tbb_threads);
|
||||
double *A = NULL;
|
||||
|
||||
// Read input matrix
|
||||
matrix_init( A, g_n, g_input_file_name );
|
||||
|
||||
// Write input matrix if output_prefix is set and we didn't read from a file
|
||||
if ( !g_input_file_name && g_output_prefix ) {
|
||||
std::string s( g_output_prefix );
|
||||
s += "_posdef.txt";
|
||||
matrix_write( A, g_n, s.c_str() );
|
||||
}
|
||||
|
||||
if ( g_alg_name.empty() ) {
|
||||
for ( algmap_t::iterator i = algmap.begin(); i != algmap.end(); ++i ) {
|
||||
algorithm* const alg = i->second;
|
||||
(*alg)( A, g_n, g_b, g_num_trials );
|
||||
}
|
||||
}
|
||||
else {
|
||||
algmap_t::iterator alg_iter = algmap.find(g_alg_name);
|
||||
|
||||
if ( alg_iter != algmap.end() ) {
|
||||
algorithm* const alg = alg_iter->second;
|
||||
(*alg)( A, g_n, g_b, g_num_trials );
|
||||
}
|
||||
else {
|
||||
printf( "ERROR: Invalid algorithm name: %s\n", g_alg_name.c_str() );
|
||||
exit( 2 );
|
||||
}
|
||||
}
|
||||
|
||||
free( A );
|
||||
return 0;
|
||||
}
|
134
cs440-acg/ext/tbb/examples/graph/cholesky/init.cpp
Normal file
134
cs440-acg/ext/tbb/examples/graph/cholesky/init.cpp
Normal file
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
Copyright (c) 2005-2020 Intel Corporation
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
#include <cstdio>
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
#include <mkl_cblas.h>
|
||||
|
||||
static void posdef_gen( double * A, int n )
|
||||
{
|
||||
/* Allocate memory for the matrix and its transpose */
|
||||
double *L = (double *)calloc( sizeof( double ), n*n );
|
||||
assert( L );
|
||||
|
||||
double *LT = (double *)calloc( sizeof( double ), n*n) ;
|
||||
assert( LT );
|
||||
|
||||
memset( A, 0, sizeof( double )*n*n );
|
||||
|
||||
/* Generate a conditioned matrix and fill it with random numbers */
|
||||
for ( int j = 0; j < n; ++j ) {
|
||||
for ( int k = 0; k < j; ++k ) {
|
||||
// The initial value has to be between [0,1].
|
||||
L[k*n+j] = ( ( (j*k) / ((double)(j+1)) / ((double)(k+2)) * 2.0) - 1.0 ) / ((double)n);
|
||||
}
|
||||
|
||||
L[j*n+j] = 1;
|
||||
}
|
||||
|
||||
/* Compute transpose of the matrix */
|
||||
for ( int i = 0; i < n; ++i ) {
|
||||
for ( int j = 0; j < n; ++j ) {
|
||||
LT[j*n+i] = L[i*n+j];
|
||||
}
|
||||
}
|
||||
cblas_dgemm( CblasColMajor, CblasNoTrans, CblasNoTrans, n, n, n, 1, L, n, LT, n, 0, A, n );
|
||||
|
||||
free( L );
|
||||
free( LT );
|
||||
}
|
||||
|
||||
// Read the matrix from the input file
|
||||
void matrix_init( double * &A, int &n, const char *fname ) {
|
||||
if( fname ) {
|
||||
int i;
|
||||
int j;
|
||||
FILE *fp;
|
||||
|
||||
fp = fopen( fname, "r" );
|
||||
if ( fp == NULL ) {
|
||||
fprintf( stderr, "\nFile does not exist\n" );
|
||||
exit( 0 );
|
||||
}
|
||||
if ( fscanf( fp, "%d", &n ) <= 0 ) {
|
||||
fprintf( stderr,"\nCouldn't read n from %s\n", fname );
|
||||
exit( 1 );
|
||||
}
|
||||
A = (double *)calloc( sizeof( double ), n*n );
|
||||
for ( i = 0; i < n; ++i ) {
|
||||
for ( j = 0; j <= i; ++j ) {
|
||||
if( fscanf( fp, "%lf ", &A[i*n+j] ) <= 0) {
|
||||
fprintf( stderr,"\nMatrix size incorrect %i %i\n", i, j );
|
||||
exit( 1 );
|
||||
}
|
||||
if ( i != j ) {
|
||||
A[j*n+i] = A[i*n+j];
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose( fp );
|
||||
} else {
|
||||
A = (double *)calloc( sizeof( double ), n*n );
|
||||
posdef_gen( A, n );
|
||||
}
|
||||
}
|
||||
|
||||
// write matrix to file
|
||||
void matrix_write ( double *A, int n, const char *fname, bool is_triangular = false )
|
||||
{
|
||||
if( fname ) {
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
FILE *fp = NULL;
|
||||
|
||||
fp = fopen( fname, "w" );
|
||||
if ( fp == NULL ) {
|
||||
fprintf( stderr, "\nCould not open file %s for writing.\n", fname );
|
||||
exit( 0 );
|
||||
}
|
||||
fprintf( fp, "%d\n", n );
|
||||
for ( i = 0; i < n; ++i) {
|
||||
for ( j = 0; j <= i; ++j ) {
|
||||
fprintf( fp, "%lf ", A[j*n+i] );
|
||||
}
|
||||
if ( !is_triangular ) {
|
||||
for ( ; j < n; ++j ) {
|
||||
fprintf( fp, "%lf ", A[i*n+j] );
|
||||
}
|
||||
} else {
|
||||
for ( ; j < n; ++j ) {
|
||||
fprintf( fp, "%lf ", 0.0 );
|
||||
}
|
||||
}
|
||||
fprintf( fp, "\n" );
|
||||
}
|
||||
if ( is_triangular ) {
|
||||
fprintf( fp, "\n" );
|
||||
for ( i = 0; i < n; ++i ) {
|
||||
for ( j = 0; j < i; ++j ) {
|
||||
fprintf( fp, "%lf ", 0.0 );
|
||||
}
|
||||
for ( ; j < n; ++j ) {
|
||||
fprintf( fp, "%lf ", A[i*n+j] );
|
||||
}
|
||||
fprintf( fp, "\n" );
|
||||
}
|
||||
}
|
||||
fclose( fp );
|
||||
}
|
||||
}
|
415
cs440-acg/ext/tbb/examples/graph/cholesky/readme.html
Normal file
415
cs440-acg/ext/tbb/examples/graph/cholesky/readme.html
Normal file
@@ -0,0 +1,415 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
::selection {
|
||||
background: #b7ffb7;
|
||||
}
|
||||
::-moz-selection {
|
||||
background: #b7ffb7;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 16px;
|
||||
width: 800px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
#banner {
|
||||
/* Div for banner */
|
||||
float:left;
|
||||
margin: 0px;
|
||||
margin-bottom: 10px;
|
||||
width: 100%;
|
||||
background-color: #0071C5;
|
||||
z-index: 0;
|
||||
}
|
||||
#banner .logo {
|
||||
/* Apply to logo in banner. Add as class to image tag. */
|
||||
float: left;
|
||||
margin-right: 20px;
|
||||
margin-left: 20px;
|
||||
margin-top: 15px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
h1 {
|
||||
text-align: center;
|
||||
font-size: 36px;
|
||||
}
|
||||
h1.title {
|
||||
/* Add as class to H1 in banner */
|
||||
font-family: "Intel Clear", Verdana, Arial, sans-serif;
|
||||
font-weight:normal;
|
||||
color: #FFFFFF;
|
||||
font-size: 170%;
|
||||
margin-right: 40px;
|
||||
margin-left: 40px;
|
||||
padding-right: 20px;
|
||||
text-indent: 20px;
|
||||
}
|
||||
.h3-alike {
|
||||
display:inline;
|
||||
font-size: 1.17em;
|
||||
font-weight: bold;
|
||||
color: #0071C5;
|
||||
}
|
||||
h3 {
|
||||
font-size: 1.17em;
|
||||
font-weight: bold;
|
||||
color: #0071C5;
|
||||
}
|
||||
.h4-alike {
|
||||
display:inline;
|
||||
font-size: 1.05em;
|
||||
font-weight: bold;
|
||||
}
|
||||
pre {
|
||||
font-family: "Consolas", Monaco, monospace;
|
||||
font-size:small;
|
||||
background: #fafafa;
|
||||
margin: 0;
|
||||
padding-left:20px;
|
||||
}
|
||||
#footer {
|
||||
font-size: small;
|
||||
}
|
||||
code {
|
||||
font-family: "Consolas", Monaco, monospace;
|
||||
}
|
||||
.code-block
|
||||
{
|
||||
padding-left:20px;
|
||||
}
|
||||
.changes {
|
||||
margin: 1em 0;
|
||||
}
|
||||
.changes input:active {
|
||||
position: relative;
|
||||
top: 1px;
|
||||
}
|
||||
.changes input:hover:after {
|
||||
padding-left: 16px;
|
||||
font-size: 10px;
|
||||
content: 'More';
|
||||
}
|
||||
.changes input:checked:hover:after {
|
||||
content: 'Less';
|
||||
}
|
||||
.changes input + .show-hide {
|
||||
display: none;
|
||||
}
|
||||
.changes input:checked + .show-hide {
|
||||
display: block;
|
||||
}
|
||||
|
||||
ul {
|
||||
margin: 0;
|
||||
padding: 0.5em 0 0.5em 2.5em;
|
||||
}
|
||||
ul li {
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
ul li:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.disc {
|
||||
list-style-type:disc
|
||||
}
|
||||
.circ {
|
||||
list-style-type:circle
|
||||
}
|
||||
|
||||
.single {
|
||||
padding: 0 0.5em;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------- */
|
||||
/* Table styles */
|
||||
table{
|
||||
margin-bottom:5pt;
|
||||
border-collapse:collapse;
|
||||
margin-left:0px;
|
||||
margin-top:0.3em;
|
||||
font-size:10pt;
|
||||
}
|
||||
tr{
|
||||
vertical-align:top;
|
||||
}
|
||||
th,
|
||||
th h3{
|
||||
padding:4px;
|
||||
text-align:left;
|
||||
background-color:#0071C5;
|
||||
font-weight:bold;
|
||||
margin-top:1px;
|
||||
margin-bottom:0;
|
||||
color:#FFFFFF;
|
||||
font-size:10pt;
|
||||
vertical-align:middle;
|
||||
}
|
||||
th{
|
||||
border:1px #dddddd solid;
|
||||
padding-top:2px;
|
||||
padding-bottom:0px;
|
||||
padding-right:3px;
|
||||
padding-left:3px;
|
||||
}
|
||||
td{
|
||||
border:1px #dddddd solid;
|
||||
vertical-align:top;
|
||||
font-size:100%;
|
||||
text-align:left;
|
||||
margin-bottom:0;
|
||||
}
|
||||
td,
|
||||
td p{
|
||||
margin-top:0;
|
||||
margin-left:0;
|
||||
text-align:left;
|
||||
font-size:inherit;
|
||||
line-height:120%;
|
||||
}
|
||||
td p{
|
||||
margin-bottom:0;
|
||||
padding-top:5px;
|
||||
padding-bottom:5px;
|
||||
padding-right:5px;
|
||||
padding-left:1px;
|
||||
}
|
||||
.noborder{
|
||||
border:0px none;
|
||||
}
|
||||
.noborder1stcol{
|
||||
border:0px none;
|
||||
padding-left:0pt;
|
||||
}
|
||||
td ol{
|
||||
font-size:inherit;
|
||||
margin-left:28px;
|
||||
}
|
||||
td ul{
|
||||
font-size:inherit;
|
||||
margin-left:24px;
|
||||
}
|
||||
.DefListTbl{
|
||||
width:90%;
|
||||
margin-left:-3pt;
|
||||
}
|
||||
.syntaxdiagramtbl{
|
||||
margin-left:-3pt;
|
||||
}
|
||||
.sdtbl{
|
||||
}
|
||||
.sdrow{
|
||||
}
|
||||
.sdtblp{
|
||||
border:0px none;
|
||||
font-size:inherit;
|
||||
line-height:120%;
|
||||
margin-bottom:0;
|
||||
padding-bottom:0px;
|
||||
padding-top:5px;
|
||||
padding-left:0px;
|
||||
padding-right:5px;
|
||||
vertical-align:top;
|
||||
}
|
||||
.idepara, .ide_para{
|
||||
border:0px none;
|
||||
font-size:inherit;
|
||||
line-height:120%;
|
||||
margin-bottom:0;
|
||||
padding-bottom:0px;
|
||||
padding-top:5px;
|
||||
padding-left:0px;
|
||||
padding-right:5px;
|
||||
vertical-align:top;
|
||||
}
|
||||
|
||||
.specs {
|
||||
border-collapse:collapse;
|
||||
}
|
||||
.specs td, .specs th {
|
||||
font-size: 14px;
|
||||
}
|
||||
.specs td {
|
||||
border: 1px solid black;
|
||||
}
|
||||
.specs td td, .specs td th {
|
||||
border: none;
|
||||
}
|
||||
.specs td, .specs td td, .specs td th {
|
||||
padding: 0 0.2em 0.2em;
|
||||
text-align: center;
|
||||
}
|
||||
.specs td tr:last-child td,
|
||||
.specs td tr:last-child th {
|
||||
padding: 0 0.2em;
|
||||
}
|
||||
.serial-time {
|
||||
}
|
||||
.modified-time {
|
||||
width: 6.5em;
|
||||
}
|
||||
.compiler {
|
||||
}
|
||||
.comp-opt {
|
||||
}
|
||||
.sys-specs {
|
||||
width: 18em;
|
||||
}
|
||||
.note {
|
||||
font-size:small;
|
||||
font-style: italic;
|
||||
}
|
||||
</style>
|
||||
<title>Intel® Threading Building Blocks. Cholesky sample</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="banner">
|
||||
<img class="logo" src="data:image/png;base64,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
|
||||
9Or1LzUmVVz+HJXDAAAAAElFTkSuQmCC">
|
||||
<h1 class="title">Intel® Threading Building Blocks.<br>Cholesky sample</h1>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
This directory contains an example of several versions of Cholesky Factorization algorithm.
|
||||
<br>
|
||||
<br><b>dpotrf</b>: An implementation that calls the Intel® Math Kernel Library (Intel® MKL) dpotrf function to directly perform the factorization. This can be a serial implementation or threaded implementation depending on the version of the Intel MKL library that is linked against.
|
||||
<br>
|
||||
<br><b>crout</b>: A serial implementation that uses the Crout-Cholesky algorithm for factorization. The same approach is parallelized for the other Intel® Threading Building Blocks (Intel® TBB) based approaches below.
|
||||
<br>
|
||||
<br><b>depend</b>: A parallel version of Crout-Cholesky factorization that uses an Intel TBB flow graph. This version uses a dependence graph made solely of continue_node objects. This an inspector-executor approach, where a loop nest that is similar to the serial implementation is used to create an unrolled version of the computation. Where the Intel MKL calls would have been made in the original serial implementation of Crout-Cholesky, instead nodes are created and these nodes are linked by edges to the other nodes that they are dependent upon. The resulting graph is relatively large, with a node for each instance of each Intel MKL call. For example, there are many nodes that call dtrsm; one for each invocation of dtrsm in the serial implementation. The is very little overhead in message management for this version and so it is often the highest performing.
|
||||
<br>
|
||||
<br><b>join</b>: A parallel version of Crout-Cholesky factorization that uses an Intel TBB flow graph. This version uses a data flow approach. This is a small, compact graph that passes tiles along its edges. There is one node per type of Intel MKL call, plus join_nodes that combine the inputs required for each call. So for example, there is only a single node that applies all calls to dtrsm. This node is invoked when the tiles that hold the inputs and outputs for an invocation are matched together in the tag-matching join_node that precedes it. The tag represents the iteration values of the i, j, k loops in the serial implementation at that invocation of the call. There is some overhead in message matching and forwarding, so it may not perform as well as the dependence graph implementation.
|
||||
<br>
|
||||
<br>This sample code requires a recent Intel TBB library (one that supports the flow graph). And also the Intel MKL library.
|
||||
</p>
|
||||
|
||||
<div class="changes">
|
||||
<div class="h3-alike">System Requirements</div>
|
||||
<input type="checkbox">
|
||||
<div class="show-hide">
|
||||
<p>
|
||||
For the most up to date system requirements, see the <a href="http://software.intel.com/en-us/articles/intel-threading-building-blocks-release-notes">release notes.</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="changes">
|
||||
<div class="h3-alike">Files</div>
|
||||
<input type="checkbox" checked="checked">
|
||||
<div class="show-hide">
|
||||
<dl>
|
||||
<dt><a href="cholesky.cpp">cholesky.cpp</a>
|
||||
<dd>Source code for example.
|
||||
<dt><a href="init.cpp">init.cpp</a>
|
||||
<dd>Source code for example.
|
||||
<dt><a href="Makefile">Makefile</a>
|
||||
<dd>Makefile for building the example.
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="changes">
|
||||
<div class="h3-alike">Directories</div>
|
||||
<input type="checkbox" checked="checked">
|
||||
<div class="show-hide">
|
||||
<dl>
|
||||
<dt><a href="msvs/">msvs</a>
|
||||
<dd>Contains Microsoft* Visual Studio* workspace for building and running the example (Windows* systems only).
|
||||
<dt><a href="xcode/">xcode</a>
|
||||
<dd>Contains Xcode* IDE workspace for building and running the example (macOS* systems only).
|
||||
</dl>
|
||||
<p>For information about the minimum supported version of IDE, see <a href="http://software.intel.com/en-us/articles/intel-threading-building-blocks-release-notes">release notes.</a></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="changes">
|
||||
<div class="h3-alike">Build instructions</div>
|
||||
<input type="checkbox" checked="checked">
|
||||
<div class="show-hide">
|
||||
<p>General build directions can be found <a href="../../index.html">here</a>.</p>
|
||||
<p>Also, you need to source Intel MKL environment variables.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="changes">
|
||||
<div class="h3-alike">Usage</div>
|
||||
<input type="checkbox" checked="checked">
|
||||
<div class="show-hide">
|
||||
<dl>
|
||||
<dt><tt>cholesky [<i>size=value</i>] [<i>blocksize=value</i>] [<i>num_trials=value</i>] [<i>output_prefix=value</i>] [<i>algorithm=value</i>] [<i>num_tbb_threads=value</i>] [<i>input_file=value</i>] [<i>-x</i>] [<i>-h</i>] [<i>size</i> [<i>blocksize</i> [<i>num_trials</i> [<i>output_prefix</i> [<i>algorithm</i> [<i>num_tbb_threads</i>]]]]]]</tt>
|
||||
<dd>where:
|
||||
<br><tt><i>size</i></tt> - the row/column size of NxN matrix (size <= 46000)
|
||||
<br><tt><i>blocksize</i></tt> - the block size; size must be a multiple of the blocksize
|
||||
<br><tt><i>num_trials</i></tt> - the number of times to run each algorithm
|
||||
<br><tt><i>output_prefix</i></tt> - if provided the prefix will be prepended to output files:
|
||||
<i>output_prefix_posdef.txt</i> and
|
||||
<i>output_prefix_X.txt</i>; where <i>X</i> is the algorithm used
|
||||
<br>if <tt><i>output_prefix</i></tt> is not provided, no output will be written
|
||||
<br><tt><i>algorithm</i></tt> - name of the used algorithm - can be dpotrf, crout, depend or join
|
||||
<br><tt><i>num_tbb_threads</i></tt> - number of started TBB threads
|
||||
<br><tt><i>input_file</i></tt> - if provided it will be read to get the input matrix
|
||||
<br><tt><i>-x</i></tt> - skips all validation
|
||||
<br><tt><i>-h</i></tt> - show this message
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<a href="../index.html">Up to parent directory</a>
|
||||
<hr>
|
||||
<div class="changes">
|
||||
<div class="h3-alike">Legal Information</div>
|
||||
<input type="checkbox">
|
||||
<div class="show-hide">
|
||||
<p>
|
||||
Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries.
|
||||
<br>* Other names and brands may be claimed as the property of others.
|
||||
<br>© 2020, Intel Corporation
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -0,0 +1,318 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
A1F593A60B8F042A00073279 /* Cholesky.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1F593A50B8F042A00073279 /* Cholesky.cpp */; };
|
||||
A1F593A60B8F053A00073279 /* init.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1F593A50B8F053A00073279 /* init.cpp */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXBuildRule section */
|
||||
C3C58951218B5ACC00DAC94C /* PBXBuildRule */ = {
|
||||
isa = PBXBuildRule;
|
||||
compilerSpec = com.intel.compilers.icc.latest;
|
||||
fileType = sourcecode.cpp;
|
||||
isEditable = 1;
|
||||
outputFiles = (
|
||||
);
|
||||
script = "# Type a script or drag a script file from your workspace to insert its path.\n";
|
||||
};
|
||||
/* End PBXBuildRule section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
8DD76F690486A84900D96B5E /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 12;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 16;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
8DD76F6C0486A84900D96B5E /* Cholesky */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Cholesky; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
A1F593A50B8F042A00073279 /* Cholesky.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Cholesky.cpp; path = ../Cholesky.cpp; sourceTree = SOURCE_ROOT; };
|
||||
A1F593A50B8F053A00073279 /* init.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = init.cpp; path = ../init.cpp; sourceTree = SOURCE_ROOT; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
8DD76F660486A84900D96B5E /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
08FB7794FE84155DC02AAC07 /* Cholesky */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
08FB7795FE84155DC02AAC07 /* Source */,
|
||||
1AB674ADFE9D54B511CA2CBB /* Products */,
|
||||
);
|
||||
name = Cholesky;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
08FB7795FE84155DC02AAC07 /* Source */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A1F593A50B8F042A00073279 /* Cholesky.cpp */,
|
||||
A1F593A50B8F053A00073279 /* init.cpp */,
|
||||
);
|
||||
name = Source;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1AB674ADFE9D54B511CA2CBB /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8DD76F6C0486A84900D96B5E /* Cholesky */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
8DD76F620486A84900D96B5E /* Cholesky */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "Cholesky" */;
|
||||
buildPhases = (
|
||||
8DD76F640486A84900D96B5E /* Sources */,
|
||||
8DD76F660486A84900D96B5E /* Frameworks */,
|
||||
8DD76F690486A84900D96B5E /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
C3C58951218B5ACC00DAC94C /* PBXBuildRule */,
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = Cholesky;
|
||||
productInstallPath = "$(HOME)/bin";
|
||||
productName = Cholesky;
|
||||
productReference = 8DD76F6C0486A84900D96B5E /* Cholesky */;
|
||||
productType = "com.apple.product-type.tool";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
08FB7793FE84155DC02AAC07 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 1000;
|
||||
};
|
||||
buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "cholesky" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 1;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = 08FB7794FE84155DC02AAC07 /* Cholesky */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
8DD76F620486A84900D96B5E /* Cholesky */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
8DD76F640486A84900D96B5E /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
A1F593A60B8F042A00073279 /* Cholesky.cpp in Sources */,
|
||||
A1F593A60B8F053A00073279 /* init.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
A1F593C60B8F0E6E00073279 /* Debug64 */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_VERSION = "";
|
||||
HEADER_SEARCH_PATHS = "$(inherited)";
|
||||
ICC_CXX_LANG_DIALECT = "c++11";
|
||||
INSTALL_PATH = "$(HOME)/bin";
|
||||
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
||||
PRODUCT_NAME = Cholesky;
|
||||
ZERO_LINK = NO;
|
||||
};
|
||||
name = Debug64;
|
||||
};
|
||||
A1F593C70B8F0E6E00073279 /* Release64 */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
||||
GCC_VERSION = "";
|
||||
HEADER_SEARCH_PATHS = "$(inherited)";
|
||||
ICC_CXX_LANG_DIALECT = "c++11";
|
||||
INSTALL_PATH = "$(HOME)/bin";
|
||||
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
||||
PRODUCT_NAME = Cholesky;
|
||||
ZERO_LINK = NO;
|
||||
};
|
||||
name = Release64;
|
||||
};
|
||||
A1F593C80B8F0E6E00073279 /* Debug64 */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
GCC_MODEL_TUNING = "";
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_VERSION = "";
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
/opt/intel/tbb/include,
|
||||
/opt/intel/mkl/include,
|
||||
);
|
||||
ICC_CXX_LANG_DIALECT = "c++11";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(TBBROOT)/lib /opt/intel/tbb/lib $(MKLROOT)/lib /opt/intel/mkl/lib";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
/opt/intel/tbb/lib,
|
||||
/opt/intel/mkl/lib,
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_CPLUSPLUSFLAGS = (
|
||||
"$(OTHER_CFLAGS)",
|
||||
"-m64",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-m64",
|
||||
"-ltbb_debug",
|
||||
"-lmkl_intel_lp64",
|
||||
"-lmkl_sequential",
|
||||
"-lmkl_core",
|
||||
);
|
||||
PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO;
|
||||
SYMROOT = "/tmp/tbb-$(USER)";
|
||||
VALID_ARCHS = x86_64;
|
||||
};
|
||||
name = Debug64;
|
||||
};
|
||||
A1F593C90B8F0E6E00073279 /* Release64 */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
GCC_MODEL_TUNING = "";
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_VERSION = "";
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
/opt/intel/tbb/include,
|
||||
/opt/intel/mkl/include,
|
||||
);
|
||||
ICC_CXX_LANG_DIALECT = "c++11";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(TBBROOT)/lib /opt/intel/tbb/lib $(MKLROOT)/lib /opt/intel/mkl/lib";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
/opt/intel/tbb/lib,
|
||||
/opt/intel/mkl/lib,
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
OTHER_CPLUSPLUSFLAGS = (
|
||||
"$(OTHER_CFLAGS)",
|
||||
"-m64",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-m64",
|
||||
"-ltbb",
|
||||
"-lmkl_intel_lp64",
|
||||
"-lmkl_sequential",
|
||||
"-lmkl_core",
|
||||
);
|
||||
PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO;
|
||||
SYMROOT = "/tmp/tbb-$(USER)";
|
||||
VALID_ARCHS = x86_64;
|
||||
};
|
||||
name = Release64;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "Cholesky" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
A1F593C60B8F0E6E00073279 /* Debug64 */,
|
||||
A1F593C70B8F0E6E00073279 /* Release64 */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release64;
|
||||
};
|
||||
1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "cholesky" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
A1F593C80B8F0E6E00073279 /* Debug64 */,
|
||||
A1F593C90B8F0E6E00073279 /* Release64 */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release64;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
|
||||
}
|
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1000"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8DD76F620486A84900D96B5E"
|
||||
BuildableName = "Cholesky"
|
||||
BlueprintName = "Cholesky"
|
||||
ReferencedContainer = "container:cholesky.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug64"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8DD76F620486A84900D96B5E"
|
||||
BuildableName = "Cholesky"
|
||||
BlueprintName = "Cholesky"
|
||||
ReferencedContainer = "container:cholesky.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Release64"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8DD76F620486A84900D96B5E"
|
||||
BuildableName = "Cholesky"
|
||||
BlueprintName = "Cholesky"
|
||||
ReferencedContainer = "container:cholesky.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<CommandLineArguments>
|
||||
<CommandLineArgument
|
||||
argument = "4"
|
||||
isEnabled = "YES">
|
||||
</CommandLineArgument>
|
||||
<CommandLineArgument
|
||||
argument = "2"
|
||||
isEnabled = "YES">
|
||||
</CommandLineArgument>
|
||||
</CommandLineArguments>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release64"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8DD76F620486A84900D96B5E"
|
||||
BuildableName = "Cholesky"
|
||||
BlueprintName = "Cholesky"
|
||||
ReferencedContainer = "container:cholesky.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug64">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release64"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
Reference in New Issue
Block a user