Changeset 821a9c6 in sasmodels


Ignore:
Timestamp:
May 18, 2016 8:48:46 AM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
aa9e4e3
Parents:
de798b6
Message:

log the compile commands

Location:
sasmodels
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kernelcl.py

    r4d76711 r821a9c6  
    5050import os 
    5151import warnings 
     52import logging 
    5253 
    5354import numpy as np 
     
    149150               if fast else []) 
    150151    program = cl.Program(context, source).build(options=options) 
     152    #print("done with "+program) 
    151153    return program 
    152154 
     
    218220        Compile the program for the device in the given context. 
    219221        """ 
    220         key = "%s-%s-%s"%(name, dtype, fast) 
     222        key = "%s-%s%s"%(name, dtype, ("-fast" if fast else "")) 
    221223        if key not in self.compiled: 
    222             #print("compiling",name) 
    223             dtype = np.dtype(dtype) 
    224             program = compile_model(self.get_context(dtype), source, dtype, fast) 
     224            context = self.get_context(dtype) 
     225            logging.info("building %s for OpenCL %s" 
     226                         % (key, context.devices[0].name)) 
     227            program = compile_model(context, source, np.dtype(dtype), fast) 
    225228            self.compiled[key] = program 
    226229        return self.compiled[key] 
  • sasmodels/kerneldll.py

    r31bc9bf r821a9c6  
    5252import ctypes as ct 
    5353from ctypes import c_void_p, c_int, c_longdouble, c_double, c_float 
     54import logging 
    5455 
    5556import numpy as np 
     
    176177        os.fdopen(fid, "w").write(source) 
    177178        command = COMPILE%{"source":filename, "output":dll} 
     179        logging.info(command) 
    178180        status = os.system(command) 
    179181        if status != 0 or not os.path.exists(dll): 
Note: See TracChangeset for help on using the changeset viewer.