bool Trajectory::Compute(const float nInitialTime,
						 const float nInitialSpeed,
						 const float nInitialParam)
{
	bool computed = false;
	
	// Initialize the constant parameters to the kernel

	mpTrajectory->maKFParam[0] = nInitialTime;
	mpTrajectory->maKFParam[2] = nInitialSpeed;
	mpTrajectory->maKFParam[3] = nInitialParam;
	
	// Bind the constant parameters to the kernel
	
	if( TrajectoryBindParameters(mpTrajectory) )
	{
		// Execute the kernel
		
		if( TrajectoryExecuteKernel(mpTrajectory) )
		{
			this->Flush();
			
			// Readback the results
			
			computed = TrajectoryReadBuffers(mpTrajectory);
		} // if
	} // if
	
    return( computed );
} // Compute
Esempio n. 2
0
static bool TrajectoryCompute(Trajectory *pTrajectory,
                              TrajectoryStruct *pSTrajectory)
{
    bool computed = false;

    // Bind the constant parameters to the kernel

    if( TrajectoryBindParameters(pSTrajectory) )
    {
        // Execute the kernel

        if( TrajectoryExecuteKernel(pSTrajectory) )
        {
            pTrajectory->Flush();

            // Readback the results

            computed = TrajectoryReadBuffers(pSTrajectory);
        } // if
    } // if

    return( computed );
} // TrajectoryCompute