Skip to content

Commit

Permalink
Revert "Added sign method to the C bridge."
Browse files Browse the repository at this point in the history
This reverts commit 3708ce4.
  • Loading branch information
kenkendk committed Apr 23, 2015
1 parent 2e650a5 commit 326a755
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 32 deletions.
4 changes: 2 additions & 2 deletions bridge/c/codegen/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ def main():
('type_header.ctpl', 'bh_c_data_types.h', types),
('type_definitions.ctpl', 'bh_c_type_definitions.hpp', types),
('implementation_basics.ctpl', 'bh_c_implementation_basics.cpp', types),
('method_header.ctpl', 'bh_c_interface.h', (op_elementwise, op_reduction, op_accumulate, types)),
('implementation.ctpl', 'bh_c_implementation.cpp',(op_elementwise, op_reduction, op_accumulate, types))
('method_header.ctpl', 'bh_c_interface.h', (op_elementwise, op_reduction, op_accumulate)),
('implementation.ctpl', 'bh_c_implementation.cpp',(op_elementwise, op_reduction, op_accumulate))
]

render( gens, tmpl_dir, output_dir, mtime)
Expand Down
1 change: 0 additions & 1 deletion bridge/c/codegen/templates/implementation.ctpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ directiveStartToken = %
%set $elementwise = $data[0]
%set $reduction = $data[1]
%set $accumulate = $data[2]
%set $types = $data[3]

using namespace bxx;

Expand Down
16 changes: 0 additions & 16 deletions bridge/c/codegen/templates/implementation_basics.ctpl
Original file line number Diff line number Diff line change
Expand Up @@ -299,20 +299,4 @@ int bh_multi_array_extmethod_${bh_ctype}_${bh_ctype2}_${bh_ctype3}(const char *n
%end for
%end for

%if $bh_atype != "bh_complex64" and $bh_atype != "bh_complex128" and $bh_atype != "bh_uint8" and $bh_atype != "bh_uint16" and $bh_atype != "bh_uint32" and $bh_atype != "bh_uint64" and $bh_atype != "bh_bool"

// Sign
void bh_multi_array_${bh_ctype}_sign(bh_multi_array_${bh_ctype}_p self, bh_multi_array_${bh_ctype}_p out) {

multi_array<${ctype}> *o = (multi_array<${ctype}> *) out;
multi_array<${ctype}> *s = (multi_array<${ctype}> *) self;

multi_array<${ctype}> t0 = ((s < 0) * ((${bh_atype})-1));
multi_array<${ctype}> t1 = ((s > 0) * ((${bh_atype})1));

bh_add(*o, t0, t1);
}

%end if

%end for
13 changes: 0 additions & 13 deletions bridge/c/codegen/templates/method_header.ctpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ extern "C" {
%set $elementwise = $data[0]
%set $reduction = $data[1]
%set $accumulate = $data[2]
%set $types = $data[3]

// Copy methods

Expand Down Expand Up @@ -93,21 +92,9 @@ DLLEXPORT void bh_multi_array_${op2_type[2]}_${opname}(bh_multi_array_${op1_type
DLLEXPORT void bh_multi_array_${op2_type[2]}_${opname}(bh_multi_array_${op1_type[2]}_p out,
const bh_multi_array_${op2_type[2]}_p in,
${op3_type[1]} axis);

%end for
%end for

// Sign functions

%for $ctype, $bh_atype, $bh_ctype, $bh_enum in $types
%if $bh_atype != "bh_complex64" and $bh_atype != "bh_complex128" and $bh_atype != "bh_uint8" and $bh_atype != "bh_uint16" and $bh_atype != "bh_uint32" and $bh_atype != "bh_uint64" and $bh_atype != "bh_bool"
DLLEXPORT void bh_multi_array_${bh_ctype}_sign(bh_multi_array_${bh_ctype}_p self,
bh_multi_array_${bh_ctype}_p out);

%end if
%end for


#ifdef __cplusplus
}
#endif
Expand Down

0 comments on commit 326a755

Please sign in to comment.