pdlcore.h (PDL-2.074) | : | pdlcore.h (PDL-2.075) | ||
---|---|---|---|---|
#ifndef __PDLCORE_H | #ifndef __PDLCORE_H | |||
#define __PDLCORE_H | #define __PDLCORE_H | |||
/* version 20: memory-management changes */ | /* version 20: memory-management changes */ | |||
/* on 21, unify pdl_thread per_pdl_flags, par_flags */ | /* on 21, unify pdl_broadcast per_pdl_flags, par_flags; remove threadloop #defin es; change creating to char */ | |||
#define PDL_CORE_VERSION 20 | #define PDL_CORE_VERSION 20 | |||
#define startbroadcastloop startthreadloop | ||||
#define pdl_startbroadcastloop pdl_startthreadloop | ||||
#define iterbroadcastloop iterthreadloop | ||||
#define pdl_iterbroadcastloop pdl_iterthreadloop | ||||
#define get_broadcastdims get_threaddims | ||||
#include "EXTERN.h" /* std perl include */ | #include "EXTERN.h" /* std perl include */ | |||
#include "perl.h" /* std perl include */ | #include "perl.h" /* std perl include */ | |||
#include "XSUB.h" /* for the win32 perlCAPI crap */ | #include "XSUB.h" /* for the win32 perlCAPI crap */ | |||
#include "ppport.h" /* include this AFTER XSUB.h */ | #include "ppport.h" /* include this AFTER XSUB.h */ | |||
#include <stdint.h> | #include <stdint.h> | |||
#if defined(CONTEXT) && defined(__osf__) | #if defined(CONTEXT) && defined(__osf__) | |||
#undef CONTEXT | #undef CONTEXT | |||
skipping to change at line 51 | skipping to change at line 56 | |||
#undef warn | #undef warn | |||
#define warn PDL_CORE_(pdl_warn) | #define warn PDL_CORE_(pdl_warn) | |||
pdl_error pdl_makescratchhash(pdl *ret, PDL_Anyval data); | pdl_error pdl_makescratchhash(pdl *ret, PDL_Anyval data); | |||
PDL_Indx av_ndcheck(AV* av, AV* dims, int level, int *datalevel); | PDL_Indx av_ndcheck(AV* av, AV* dims, int level, int *datalevel); | |||
pdl* pdl_from_array(AV* av, AV* dims, int type, pdl* p); | pdl* pdl_from_array(AV* av, AV* dims, int type, pdl* p); | |||
PDL_Anyval pdl_at( void* x, int datatype, PDL_Indx* pos, PDL_Indx* dims, /* Valu e at x,y,z,... */ | PDL_Anyval pdl_at( void* x, int datatype, PDL_Indx* pos, PDL_Indx* dims, /* Valu e at x,y,z,... */ | |||
PDL_Indx *incs, PDL_Indx offset, PDL_Indx ndims); | PDL_Indx *incs, PDL_Indx offset, PDL_Indx ndims); | |||
pdl_error pdl_writebackdata_vaffine(pdl *it); | pdl_error pdl_writebackdata_vaffine(pdl *it); | |||
pdl_error pdl_readdata_vaffine(pdl *it); | pdl_error pdl_readdata_vaffine(pdl *it); | |||
pdl_error pdl_dim_checks(pdl_transvtable *vtable, pdl **pdls, | ||||
pdl_broadcast *broadcast, PDL_Indx *creating, | ||||
PDL_Indx *ind_sizes, char load_only); | ||||
/* pdlutil.c */ | /* pdlutil.c */ | |||
typedef enum { | typedef enum { | |||
PDL_FLAGS_TRANS, | PDL_FLAGS_TRANS, | |||
PDL_FLAGS_PDL, | PDL_FLAGS_PDL, | |||
PDL_FLAGS_VTABLE | PDL_FLAGS_VTABLE | |||
} pdl_flags; | } pdl_flags; | |||
pdl_error pdl_croak_param(pdl_transvtable *transvtable, int paramIndex, char *pa t, ...); | pdl_error pdl_croak_param(pdl_transvtable *transvtable, int paramIndex, char *pa t, ...); | |||
void pdl_print_iarr(PDL_Indx *iarr, int n); | void pdl_print_iarr(PDL_Indx *iarr, int n); | |||
void pdl_dump_thread(pdl_thread *thread); | void pdl_dump_broadcast(pdl_broadcast *broadcast); | |||
void pdl_dump_threading_info( | void pdl_dump_broadcasting_info( | |||
int npdls, PDL_Indx* creating, int target_pthread, | int npdls, PDL_Indx* creating, int target_pthread, | |||
PDL_Indx *nthreadedDims, PDL_Indx **threadedDims, PDL_Indx **threadedDimSizes, | PDL_Indx *nbroadcastedDims, PDL_Indx **broadcastedDims, PDL_Indx **broadcasted DimSizes, | |||
int maxPthreadPDL, int maxPthreadDim, int maxPthread | int maxPthreadPDL, int maxPthreadDim, int maxPthread | |||
); | ); | |||
void pdl_thread_mismatch_msg( | void pdl_broadcast_mismatch_msg( | |||
char *s, | char *s, | |||
pdl **pdls, pdl_thread *thread, | pdl **pdls, pdl_broadcast *broadcast, | |||
PDL_Indx i, PDL_Indx j, PDL_Indx nimpl, | PDL_Indx i, PDL_Indx j, PDL_Indx nimpl, | |||
PDL_Indx *realdims,PDL_Indx *creating | PDL_Indx *realdims,PDL_Indx *creating | |||
); | ); | |||
void pdl_dump_flags_fixspace(int flags, int nspac, pdl_flags type); | void pdl_dump_flags_fixspace(int flags, int nspac, pdl_flags type); | |||
void pdl_dump_trans_fixspace(pdl_trans *it, int nspac); | void pdl_dump_trans_fixspace(pdl_trans *it, int nspac); | |||
void pdl_dump_anyval(PDL_Anyval v); | void pdl_dump_anyval(PDL_Anyval v); | |||
#define PDL_CORE_LIST(X) \ | #define PDL_CORE_LIST(X) \ | |||
X(SvPDLV, pdl*, ( SV* )) \ | X(SvPDLV, pdl*, ( SV* )) \ | |||
X(SetSV_PDL, void, ( SV *sv, pdl *it )) \ | X(SetSV_PDL, void, ( SV *sv, pdl *it )) \ | |||
skipping to change at line 91 | skipping to change at line 99 | |||
X(null, pdl*, ()) \ | X(null, pdl*, ()) \ | |||
X(scalar, pdl*, (PDL_Anyval anyval)) \ | X(scalar, pdl*, (PDL_Anyval anyval)) \ | |||
X(hard_copy, pdl*, ( pdl* )) \ | X(hard_copy, pdl*, ( pdl* )) \ | |||
X(converttype, pdl_error, ( pdl*, int )) \ | X(converttype, pdl_error, ( pdl*, int )) \ | |||
X(smalloc, void*, ( STRLEN )) \ | X(smalloc, void*, ( STRLEN )) \ | |||
X(howbig, size_t, ( int )) \ | X(howbig, size_t, ( int )) \ | |||
X(packdims, PDL_Indx*, ( SV* sv, PDL_Indx *ndims )) \ | X(packdims, PDL_Indx*, ( SV* sv, PDL_Indx *ndims )) \ | |||
X(setdims, pdl_error, ( pdl* it, PDL_Indx* dims, PDL_Indx ndims )) \ | X(setdims, pdl_error, ( pdl* it, PDL_Indx* dims, PDL_Indx ndims )) \ | |||
X(at0, PDL_Anyval, ( pdl* x )) \ | X(at0, PDL_Anyval, ( pdl* x )) \ | |||
X(reallocdims, pdl_error, ( pdl *it,PDL_Indx ndims )) \ | X(reallocdims, pdl_error, ( pdl *it,PDL_Indx ndims )) \ | |||
X(reallocthreadids, pdl_error, ( pdl *it,PDL_Indx ndims )) \ | X(reallocbroadcastids, pdl_error, ( pdl *it,PDL_Indx ndims )) \ | |||
X(resize_defaultincs, void, ( pdl *it )) /* Make incs out of dims */ \ | X(resize_defaultincs, void, ( pdl *it )) /* Make incs out of dims */ \ | |||
X(clearthreadstruct, void, (pdl_thread *it)) \ | X(clearbroadcaststruct, void, (pdl_broadcast *it)) \ | |||
X(initthreadstruct, pdl_error, (int nobl,pdl **pdls,PDL_Indx *realdims, \ | X(initbroadcaststruct, pdl_error, (int nobl,pdl **pdls,PDL_Indx *realdims, \ | |||
PDL_Indx *creating,PDL_Indx npdls,pdl_transvtable *transvtable, \ | PDL_Indx *creating,PDL_Indx npdls,pdl_transvtable *transvtable, \ | |||
pdl_thread *thread,PDL_Indx *ind_sizes,PDL_Indx *inc_sizes, \ | pdl_broadcast *broadcast,PDL_Indx *ind_sizes,PDL_Indx *inc_sizes, \ | |||
char *flags, int noPthreadFlag)) \ | char *flags, int noPthreadFlag)) \ | |||
X(redodims_default, pdl_error, (pdl_trans *)) \ | X(redodims_default, pdl_error, (pdl_trans *)) \ | |||
X(startthreadloop, int, (pdl_thread *thread,pdl_error (*func)(pdl_trans *), \ | X(startbroadcastloop, int, (pdl_broadcast *broadcast,pdl_error (*func)(pdl_tra ns *), \ | |||
pdl_trans *, pdl_error *)) \ | pdl_trans *, pdl_error *)) \ | |||
X(get_threadoffsp, PDL_Indx*, (pdl_thread *thread)) /* For pthreading */ \ | X(get_threadoffsp, PDL_Indx*, (pdl_broadcast *broadcast)) /* For pthreading */ | |||
X(get_threaddims, PDL_Indx*, (pdl_thread *thread)) /* For pthreading */ \ | \ | |||
X(iterthreadloop, int, (pdl_thread *thread, PDL_Indx which)) \ | X(get_broadcastdims, PDL_Indx*, (pdl_broadcast *broadcast)) /* For pthreading | |||
X(freethreadstruct, void, (pdl_thread *thread)) \ | */ \ | |||
X(thread_create_parameter, pdl_error, (pdl_thread *thread,PDL_Indx j, \ | X(iterbroadcastloop, int, (pdl_broadcast *broadcast, PDL_Indx which)) \ | |||
X(freebroadcaststruct, void, (pdl_broadcast *broadcast)) \ | ||||
X(broadcast_create_parameter, pdl_error, (pdl_broadcast *broadcast,PDL_Indx j, | ||||
\ | ||||
PDL_Indx *dims, int temp)) \ | PDL_Indx *dims, int temp)) \ | |||
X(add_deletedata_magic, pdl_error, (pdl *it,void (*func)(pdl *, Size_t param) , \ | X(add_deletedata_magic, pdl_error, (pdl *it,void (*func)(pdl *, Size_t param) , \ | |||
Size_t param)) /* Automagic destructor */ \ | Size_t param)) /* Automagic destructor */ \ | |||
X(setdims_careful, pdl_error, (pdl *pdl)) \ | X(setdims_careful, pdl_error, (pdl *pdl)) \ | |||
X(get_offs, PDL_Anyval, (pdl *pdl,PDL_Indx offs)) \ | X(get_offs, PDL_Anyval, (pdl *pdl,PDL_Indx offs)) \ | |||
X(set, pdl_error, ( void* x, int datatype, PDL_Indx* pos, PDL_Indx* dims, \ | X(set, pdl_error, ( void* x, int datatype, PDL_Indx* pos, PDL_Indx* dims, \ | |||
PDL_Indx *incs, PDL_Indx offs, PDL_Indx ndims, PDL_Anyval value)) \ | PDL_Indx *incs, PDL_Indx offs, PDL_Indx ndims, PDL_Anyval value)) \ | |||
X(create_trans, pdl_trans *, (pdl_transvtable *vtable)) \ | X(create_trans, pdl_trans *, (pdl_transvtable *vtable)) \ | |||
X(type_coerce, pdl_error, (pdl_trans *trans)) \ | X(type_coerce, pdl_error, (pdl_trans *trans)) \ | |||
X(trans_badflag_from_inputs, char, (pdl_trans *trans)) \ | X(trans_badflag_from_inputs, char, (pdl_trans *trans)) \ | |||
End of changes. 12 change blocks. | ||||
16 lines changed or deleted | 27 lines changed or added |