示例#1
0
文件: egtb.cpp 项目: raimarHD/lcec
void CTablebases::unload(void)
{
    m_usage = eTbUsageNever;
    m_path.clear();
    setCacheSize(0);
    m_loaded_men = 0;
    clearHits();
}
TickCache::~TickCache()
{
   if (mTickCacheHead)
   {
      setCacheSize(0);
      freeHead(mTickCacheHead);
      mTickCacheHead = NULL;
   }
}
示例#3
0
文件: seqCache.C 项目: Ecogpr/canu
seqCache::seqCache(const char *filename, uint32 cachesize, bool verbose) {

  _fb                  = openSeqFile(filename);
  _idToGetNext         = 0;

  _allSequencesLoaded  = false;
  _reportLoading       = verbose;

  _cacheMap            = 0L;
  _cacheSize           = 0;
  _cacheNext           = 0;
  _cache               = 0L;

  setCacheSize(cachesize);
}
示例#4
0
文件: GTB.cpp 项目: gekomad/Cinnamon
bool GTB::load() {
    if (path.size() == 0)return false;
    memset(installedPieces, 0, sizeof(installedPieces));
    if (!FileUtil::fileExists(path)) {
        cout << "file not found " << path << endl;
        return false;
    }
    tbstats_reset();
    paths = tbpaths_done(paths);
    paths = tbpaths_init();
    _assert(paths);
    paths = tbpaths_add(paths, path.c_str());
    restart();
    unsigned av = tb_availability();
    if (0 != (av & 2)) {
        setInstalledPieces(3);
        cout << "3-pc TBs complete\n";
    } else if (0 != (av & 1)) {
        cout << "Some 3-pc TBs available\n";
    } else {
        cout << "No 3-pc TBs available\n";
    }
    if (0 != (av & 8)) {
        setInstalledPieces(4);
        cout << "4-pc TBs complete\n";
    } else if (0 != (av & 4)) {
        cout << "Some 4-pc TBs available\n";
    } else {
        cout << "No 4-pc TBs available\n";
    }
    if (0 != (av & 32)) {
        setInstalledPieces(5);
        cout << "5-pc TBs complete\n";
    } else if (0 != (av & 16)) {
        cout << "Some 5-pc TBs available\n";
    } else {
        cout << "No 5-pc TBs available\n";
    }
    cout << endl;
    if (!getAvailable()) {
        return false;
    }
    setCacheSize(cacheSize);
    tb_init(verbosity, scheme, paths);
    tbcache_init(cacheSize * 1024 * 1024, wdl_fraction);
    tbstats_reset();
    return true;
}
示例#5
0
文件: device.cpp 项目: nyue/embree
  void Device::setParameter1i(const RTCParameter parm, ssize_t val)
  {
    /* hidden internal parameters */
    switch ((size_t)parm)
    {
    case 1000000: debug_int0 = val; return;
    case 1000001: debug_int1 = val; return;
    case 1000002: debug_int2 = val; return;
    case 1000003: debug_int3 = val; return;
    }

    switch (parm) {
    case RTC_SOFTWARE_CACHE_SIZE: setCacheSize(val); break;
    default: throw_RTCError(RTC_INVALID_ARGUMENT, "unknown writable parameter"); break;
    };
  }
示例#6
0
bool xFT2Font::init( xXmlNode* pFontNode)
{
	xFontLoader* pFontLoader = m_pFontLoader;

	const wchar_t*  pFontName    = pFontNode->value(L"name");
	const wchar_t*  famillyName  = pFontNode->value(L"familly" ) ;
	wstring         fullFontName = wstring( famillyName ) + pFontName; 
	const  wchar_t* pFiltertName   = pFontNode->value(L"filter");

	//从配置文件取到数据
	xFontInitor fi;
	fi.height     = pFontNode->int_value(L"height");
	fi.width      = pFontNode->int_value(L"width");
	fi.antialias  = pFontNode->bool_value(L"antialias");
	fi.bold       = pFontNode->bool_value(L"bold");
	fi.italic     = pFontNode->bool_value(L"italic");
	fi.underline  = pFontNode->bool_value(L"underline");
	fi.maxcache   = pFontNode->int_value(L"maxcache");
	fi.filter =     pFontLoader->getFontSamplerFilter(pFiltertName);
	fi.linepitch  = 0;
	if(pFontNode->value(L"line_pitch"))
	{
		fi.linepitch = pFontNode->int_value(L"line_pitch");
	}


	wchar_t fileName[512]={0};
	GetFontFileName(pFontNode->value(L"file") , fileName);
	wstring AbsFontFile = _XEVOL_ABSPATH_(fileName);


	//因为是个新字体,所以需要做一个FontCharMgr来管理它
	createFontCharManager( fullFontName.c_str() ) ;
	xFT2FontCharMgr* pFontCharMgr = getFontCharManager();

	pFontCharMgr->setRenderer(m_pRendeDevice);
	pFontCharMgr->m_UnderLine = fi.underline;
	pFontCharMgr->m_bBold     = fi.bold;
	pFontCharMgr->m_Italic    = fi.italic;
	pFontCharMgr->m_bAntilias = fi.antialias;

	int maxCache = fi.maxcache;
	if(maxCache == 0) maxCache = 1024;

	if( pFontCharMgr->load_font(AbsFontFile.c_str(), fi.width , fi.height) ==false)
	{
		delete pFontCharMgr;
		return NULL; 
	}

	
	//pFontCharMgr->setMaxSize(maxCache);
	//g_FT2FontCharMgr.push_back(pFontCharMgr);

	//新建一个FreeType2的字体绘制器。并把它和Font


	m_Filter          = fi.filter;
	m_Info.bAntialias = fi.antialias;
	m_Info.bBold      = fi.bold;
	m_Info.bItalic    = fi.italic;
	m_Info.bUnderLine = fi.underline;

	m_Info.nMaxWidth  = GetBoldenSize(fi.bold,fi.width );
	m_Info.nMaxHeight = GetBoldenSize(fi.bold,fi.height);
	wcsncpy(m_Info.strFamilly , famillyName , 32);
	wcsncpy(m_Info.strName    , pFontName,         16);
	m_Info.nHeight =  fi.height;
	m_Info.nWidth  =  fi.width;
	m_LinePitch = fi.linepitch;

    setCacheSize(maxCache );
	return true;
}
示例#7
0
  Device::Device (const char* cfg)
  {
    /* check CPU */
    if (!hasISA(ISA)) 
      throw_RTCError(RTC_ERROR_UNSUPPORTED_CPU,"CPU does not support " ISA_STR);

    /* initialize global state */
    State::parseString(cfg);
    if (!ignore_config_files && FileName::executableFolder() != FileName(""))
      State::parseFile(FileName::executableFolder()+FileName(".embree" TOSTRING(RTC_VERSION_MAJOR)));
    if (!ignore_config_files && FileName::homeFolder() != FileName(""))
      State::parseFile(FileName::homeFolder()+FileName(".embree" TOSTRING(RTC_VERSION_MAJOR)));
    State::verify();

    /*! do some internal tests */
    assert(isa::Cylinder::verify());

    /*! enable huge page support if desired */
#if defined(__WIN32__)
    if (State::enable_selockmemoryprivilege)
      State::hugepages_success &= win_enable_selockmemoryprivilege(State::verbosity(3));
#endif
    State::hugepages_success &= os_init(State::hugepages,State::verbosity(3));
    
    /*! set tessellation cache size */
    setCacheSize( State::tessellation_cache_size );

    /*! enable some floating point exceptions to catch bugs */
    if (State::float_exceptions)
    {
      int exceptions = _MM_MASK_MASK;
      //exceptions &= ~_MM_MASK_INVALID;
      exceptions &= ~_MM_MASK_DENORM;
      exceptions &= ~_MM_MASK_DIV_ZERO;
      //exceptions &= ~_MM_MASK_OVERFLOW;
      //exceptions &= ~_MM_MASK_UNDERFLOW;
      //exceptions &= ~_MM_MASK_INEXACT;
      _MM_SET_EXCEPTION_MASK(exceptions);
    }

    /* print info header */
    if (State::verbosity(1))
      print();
    if (State::verbosity(2)) 
      State::print();

    /* register all algorithms */
    bvh4_factory = make_unique(new BVH4Factory(enabled_builder_cpu_features, enabled_cpu_features));

#if defined(EMBREE_TARGET_SIMD8)
    bvh8_factory = make_unique(new BVH8Factory(enabled_builder_cpu_features, enabled_cpu_features));
#endif

    /* setup tasking system */
    initTaskingSystem(numThreads);

    /* ray stream SOA to AOS conversion */
#if defined(EMBREE_RAY_PACKETS)
    RayStreamFilterFuncsType rayStreamFilterFuncs;
    SELECT_SYMBOL_DEFAULT_SSE42_AVX_AVX2_AVX512KNL_AVX512SKX(enabled_cpu_features,rayStreamFilterFuncs);
    rayStreamFilters = rayStreamFilterFuncs();
#endif
  }
示例#8
0
 Device::~Device ()
 {
   setCacheSize(0);
   exitTaskingSystem();
 }