 			}
 
 		// calculate the virial (FLOPS: 3)
-		virial += float(1.0/6.0) * rsq * forcemag_divr;
+		if (!slj) virial += float(1.0/6.0) * rsq * forcemag_divr;
+		else virial += float(1.0/6.0) * r * r * forcemag_divr; //rsq has been "adjusted" for diameter, r has not!
 
 		// add up the force vector components (FLOPS: 7)
 		force.x += dx * forcemag_divr;

		// calculate r squard (FLOPS: 5)
		float rsq = dx*dx + dy*dy + dz*dz;
		
		// calculate 1/r^2 (FLOPS: 2)
		float r2inv;
		if (rsq >= r_cutsq)

		// get the neighbor's position (MEM TRANSFER: 16 bytes)
		float4 neigh_pos = tex1Dfetch(pdata_pos_tex, cur_neigh);
		
		float neigh_diam;
		if (slj) {
			// get the neighbor's diameter (MEM TRANSFER: 4 bytes)
			neigh_diam = tex1Dfetch(pdata_diam_tex, cur_neigh);
			}
		
		// calculate dr (with periodic boundary conditions) (FLOPS: 3)
