Skip to content

Commit d9a8471

Browse files
maresbricardoV94
authored andcommitted
Remove dead C code importing time.h
1 parent 24a2234 commit d9a8471

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

pytensor/tensor/blas.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -460,13 +460,6 @@ def c_support_code(self, **kwargs):
460460
#ifndef MOD
461461
#define MOD %
462462
#endif
463-
static double time_time() // a time function like time.perf_counter()
464-
{
465-
struct timeval tv;
466-
gettimeofday(&tv, 0);
467-
return (double) tv.tv_sec + (double) tv.tv_usec / 1000000.0;
468-
}
469-
470463
void compute_strides(npy_intp *shape, int N_shape, int type_size, npy_intp *res) {
471464
int s;
472465
res[N_shape - 1] = type_size;
@@ -481,7 +474,7 @@ def c_support_code(self, **kwargs):
481474
def c_headers(self, **kwargs):
482475
# std.cout doesn't require the '%' symbol to print stuff...
483476
# so it works much better with python's string-substitution stuff.
484-
return ["<iostream>", "<time.h>", "<sys/time.h>"]
477+
return ["<iostream>"]
485478

486479
def c_libraries(self, **kwargs):
487480
return ldflags()
@@ -690,8 +683,6 @@ def c_header_dirs(self, **kwargs):
690683
char N = 'N';
691684
char T = 'T';
692685
int Nz0 = Nz[0], Nz1 = Nz[1], Nx1 = Nx[1];
693-
//std::cerr << (unit/256) MOD 16 << (unit / 16) MOD 16 << unit MOD 16<< '\\n';
694-
//double t0 = time_time();
695686
switch(unit)
696687
{
697688
case 0x000: sgemm_(&N, &N, &Nz1, &Nz0, &Nx1, &a, y, &sy_0, x, &sx_0, &b, z, &sz_0); break;
@@ -704,7 +695,6 @@ def c_header_dirs(self, **kwargs):
704695
case 0x111: sgemm_(&N, &N, &Nz0, &Nz1, &Nx1, &a, x, &sx_1, y, &sy_1, &b, z, &sz_1); break;
705696
default: PyErr_SetString(PyExc_ValueError, "some matrix has no unit stride"); %(fail)s;
706697
};
707-
//fprintf(stderr, "Calling sgemm %%i %%i %%i %%i took %%f\\n", unit, Nz1, Nz0, Nx1, time_time() - t0);
708698
"""
709699

710700
case_double = """
@@ -723,14 +713,6 @@ def c_header_dirs(self, **kwargs):
723713
char N = 'N';
724714
char T = 'T';
725715
int Nz0 = Nz[0], Nz1 = Nz[1], Nx1 = Nx[1];
726-
//std::cerr << (unit/256) MOD 16 << (unit / 16) MOD 16 << unit MOD 16<< '\\n';
727-
//double t0 = time_time();
728-
//fprintf(stderr, "unit=%%x N= %%i %%i %%i S = %%i %%i %%i %%i %%i %%i\\n", unit,
729-
//Nz1, Nz0, Nx1,
730-
//sy_0, sy_1,
731-
//sx_0, sx_1,
732-
//sz_0, sz_1
733-
//);
734716
switch(unit)
735717
{
736718
case 0x000: dgemm_(&N, &N, &Nz1, &Nz0, &Nx1, &a, y,
@@ -753,8 +735,6 @@ def c_header_dirs(self, **kwargs):
753735
"some matrix has no unit stride");
754736
%(fail)s;
755737
};
756-
//fprintf(stderr, "Calling dgemm %%i %%i %%i %%i took %%f\\n",
757-
// unit, Nz1, Nz0, Nx1, time_time()- t0);
758738
"""
759739

760740
end_switch_typenum = """

0 commit comments

Comments
 (0)