View | Details | Raw Unified
Collapse All | Expand All

(-) numpy-1.0.4/numpy/distutils/cpuinfo.py (-25 / +35 lines)
 Lines 18-23    Link Here 
import os
import os
import commands
import commands
import warnings
import warnings
import platform
def getoutput(cmd, successful_status=(0,), stacklevel=1):
def getoutput(cmd, successful_status=(0,), stacklevel=1):
    try:
    try:
 Lines 80-87    Link Here 
    def _getNCPUs(self):
    def _getNCPUs(self):
        return 1
        return 1
    def __get_nbits(self):
        abits = platform.architecture()[0]
        nbits = re.compile('(\d+)bit').search(abits).group(1)
        return nbits
    def _is_32bit(self):
    def _is_32bit(self):
        return not self.is_64bit()
        return self.__get_nbits() == '32'
    def _is_64bit(self):
        return self.__get_nbits() == '64'
class LinuxCPUInfo(CPUInfoBase):
class LinuxCPUInfo(CPUInfoBase):
 Lines 104-110    Link Here 
                if len(name_value) != 2:
                if len(name_value) != 2:
                    continue
                    continue
                name, value = name_value
                name, value = name_value
                if not info or info[-1].has_key(name): # next processor
                if not info or name in info[-1]: # next processor
                    info.append({})
                    info.append({})
                info[-1][name] = value
                info[-1][name] = value
            fo.close()
            fo.close()
 Lines 134-140    Link Here 
                        self.info[0]['model name']) is not None
                        self.info[0]['model name']) is not None
    def _is_AMD64(self):
    def _is_AMD64(self):
        return self.is_AMD() and self.info[0]['family'] == '15'
        if 'family' in self.info[0]:
          family=self.info[0]['family'] in ['15','16']
        else:
          family=False
        if 'cpu family' in self.info[0]:
          cpu_family=self.info[0]['cpu family']in ['15','16']
        else:
          cpu_family=False
        result=(self.is_AMD() and family) or cpu_family
        return result    	
    def _is_Athlon64(self):
    def _is_Athlon64(self):
        return re.match(r'.*?Athlon\(tm\) 64\b',
        return re.match(r'.*?Athlon\(tm\) 64\b',
 Lines 152-157    Link Here 
        return re.match(r'.*?Hammer\b',
        return re.match(r'.*?Hammer\b',
                        self.info[0]['model name']) is not None
                        self.info[0]['model name']) is not None
    def _is_Phenom(self):
	return re.match(r'.*?Phenom\b',
			self.info[0]['model name']) is not None
    # Alpha
    # Alpha
    def _is_Alpha(self):
    def _is_Alpha(self):
 Lines 222-228    Link Here 
        return self.is_PentiumIV() and self.has_sse3()
        return self.is_PentiumIV() and self.has_sse3()
    def _is_Nocona(self):
    def _is_Nocona(self):
        return self.is_64bit() and self.is_PentiumIV()
        return self.is_Intel() \
               and (self.info[0]['cpu family'] == '6' \
                    or self.info[0]['cpu family'] == '15' ) \
               and (self.has_sse3() and not self.has_ssse3())\
               and re.match(r'.*?\blm\b',self.info[0]['flags']) is not None
    def _is_Core2(self):
    def _is_Core2(self):
        return self.is_64bit() and self.is_Intel() and \
        return self.is_64bit() and self.is_Intel() and \
 Lines 263-269    Link Here 
        return re.match(r'.*?\bsse2\b',self.info[0]['flags']) is not None
        return re.match(r'.*?\bsse2\b',self.info[0]['flags']) is not None
    def _has_sse3(self):
    def _has_sse3(self):
        return re.match(r'.*?\bsse3\b',self.info[0]['flags']) is not None
        return re.match(r'.*?\bpni\b',self.info[0]['flags']) is not None
    def _has_ssse3(self):
        return re.match(r'.*?\bssse3\b',self.info[0]['flags']) is not None
    def _has_3dnow(self):
    def _has_3dnow(self):
        return re.match(r'.*?\b3dnow\b',self.info[0]['flags']) is not None
        return re.match(r'.*?\b3dnow\b',self.info[0]['flags']) is not None
 Lines 271-290    Link Here 
    def _has_3dnowext(self):
    def _has_3dnowext(self):
        return re.match(r'.*?\b3dnowext\b',self.info[0]['flags']) is not None
        return re.match(r'.*?\b3dnowext\b',self.info[0]['flags']) is not None
    def _is_64bit(self):
        if self.is_Alpha():
            return True
        if self.info[0].get('clflush size','')=='64':
            return True
        if self.info[0].get('uname_m','')=='x86_64':
            return True
        if self.info[0].get('arch','')=='IA-64':
            return True
        return False
    def _is_32bit(self):
        return not self.is_64bit()
class IRIXCPUInfo(CPUInfoBase):
class IRIXCPUInfo(CPUInfoBase):
    info = None
    info = None
 Lines 412-422    Link Here 
    def _not_impl(self): pass
    def _not_impl(self): pass
    def _is_32bit(self):
        return self.info['isainfo_b']=='32'
    def _is_64bit(self):
        return self.info['isainfo_b']=='64'
    def _is_i386(self):
    def _is_i386(self):
        return self.info['isainfo_n']=='i386'
        return self.info['isainfo_n']=='i386'
    def _is_sparc(self):
    def _is_sparc(self):
 Lines 552-558    Link Here 
    # require looking at the 'brand' from cpuid
    # require looking at the 'brand' from cpuid
    def _is_AMD64(self):
    def _is_AMD64(self):
        return self.is_AMD() and self.info[0]['Family'] == 15
        return self.is_AMD() and self.info[0]['Family'] in [15,16]
    # Intel
    # Intel