Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/pure-cfg/src/clinfo/clinfo.c
ViewVC logotype

View of /branches/pure-cfg/src/clinfo/clinfo.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1242 - (download) (as text) (annotate)
Wed May 18 15:01:28 2011 UTC (10 years, 4 months ago) by jhr
File size: 1231 byte(s)
  Starting work on clinfo utility program
/*! \file clinfo.c
 *
 * \author John Reppy
 *
 * \brief This program is used to determine properties of the host machine's
 * OpenCL support.
 *
 * Usage:
 *	clinfo cmd [args]
 *
 *	where cmd is one of
 *		platforms		-- prints a list of OpenCL platforms supported by the
 *					   host.
 *		version	platform	-- prints version of OpenCL supported by the platform
 *		devices			-- prints a list of devices
 *		extensions device	-- prints a list of extensions that are
 *					   supported by the device
 */

/*
 * COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu)
 * All rights reserved.
 */

#include "Diderot/config.h"
# ifdef HAVE_CL_CL_H
#   include <CL/cl.h>
# elif defined(HAVE_OPENCL_CL_H)
#   include <OpenCL/cl.h>
# else
#   error no cl.h
# endif
#include <stdio.h>

int main (int argc, const char **argv)
{
    cl_platform_id	platforms[MAX_PLATFORMS];
    int			numPlatforms;

  // get number of OpenCL platforms
    if (clGetPlatformIDs (MAX_PLATFORMS, platforms, &numPlatforms) != CL_SUCCESS) {
	fprintf(stderr, "unable to get platform IDs\n");
	return 1;
    }


#if defined(CL_VERSION_1_1)
#elif define(CL_VERSION_1_0)
#else
#   error unable to determine minimum OpenCL version
#endif

}

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0