GCACHE

From Jacket Wiki

Jump to: navigation, search
Back to Jacket Function List, Jacket Basics

Save GPU compiled code for given MATLAB script

Supported Syntax

gcache
gcache flush
gcache load
gcache load <filename>
gcache save
gcache save <filename>

For diagnostic purposes:

gcache enable
gcache disable

GFOR Compatibility?

No, do not use inside a GFOR loop.

Description

During the course of a MATLAB session, GPU computations are compiled and stored in an on-disk cache to improve performance between MATLAB sessions. GCACHE allows granular control over this functionality. During typical usage of MATLAB, a default cache (locations for each OS given below) is updated to contain all GPU compiled code utilized thus far. However, for specific scripts, the user may save compiled GPU code to a user-defined cache which can then be loaded in another MATLAB session to avoid time-consuming compilation.

The GCACHE command allows the user to manipulate the cache by flushing it, saving it, or loading it.

Syntaxes:

  • GCACHE FLUSH flushes any entries in the cache, leaving an empty cache in memory.
  • GCACHE LOAD loads default cache, merging it with any GPU code already in memory.
  • GCACHE LOAD <FILENAME> Loads the specified cache, merging it with any GPU code already in memory.
  • GCACHE SAVE will save all cache entries in memory to the default cache.
  • GCACHE SAVE <FILENAME> will save all cache entries in memory to the specified file.

For diagnostic purposes, it may be useful to disable caching while investigating errors. Please contact Support before resorting to use these switches.

  • GCACHE ENABLE enables caching for the current MATLAB session. Default state is enabled.
  • GCACHE DISABLE disables caching for the current MATLAB session.


For Example:

gcache save my_cache.jkt

This will create my_cache.jkt on disk containing all compiled GPU code for the current MATLAB session. Run this after a large script to avoid recompilation in the next MATLAB session or share this with other users.

OS Specific default cache locations:

     - Windows; 	$TEMP/cache.jkt
     - Linux/OSX; 	$HOME/.cache.jkt

See Also

GINFO, GACTIVATE, GHELP

Views
Personal tools